Fix resuming when downloading in chunked mode
diff --git a/src/you_get/common.py b/src/you_get/common.py
index 2e4edef5b9..41d67cfc16 100755
--- a/src/you_get/common.py
+++ b/src/you_get/common.py
@@ -629,10 +629,12 @@ def url_save(
     if refer is not None:
         tmp_headers['Referer'] = refer
     if type(url) is list:
-        file_size = urls_size(url, faker=faker, headers=tmp_headers)
+        chunk_sizes = [url_size(url, faker=faker, headers=tmp_headers) for url in url]
+        file_size = sum(chunk_sizes)
         is_chunked, urls = True, url
     else:
         file_size = url_size(url, faker=faker, headers=tmp_headers)
+        chunk_sizes = [file_size]
         is_chunked, urls = False, [url]
 
     continue_renameing = True
@@ -696,9 +698,13 @@ def numreturn(a):
     else:
         open_mode = 'wb'
 
-    for url in urls:
+    chunk_start = 0
+    chunk_end = 0
+    for i, url in enumerate(urls):
         received_chunk = 0
-        if received < file_size:
+        chunk_start += 0 if i == 0 else chunk_sizes[i - 1]
+        chunk_end += chunk_sizes[i]
+        if received < file_size and received < chunk_end:
             if faker:
                 tmp_headers = fake_headers
             '''
@@ -708,8 +714,9 @@ def numreturn(a):
             else:
                 headers = {}
             '''
-            if received and not is_chunked:  # only request a range when not chunked
-                tmp_headers['Range'] = 'bytes=' + str(received) + '-'
+            if received:
+                # chunk_start will always be 0 if not chunked
+                tmp_headers['Range'] = 'bytes=' + str(received - chunk_start) + '-'
             if refer:
                 tmp_headers['Referer'] = refer
 
@@ -757,8 +764,7 @@ def numreturn(a):
                         elif not is_chunked and received == file_size:  # Download finished
                             break
                         # Unexpected termination. Retry request
-                        if not is_chunked:  # when
-                            tmp_headers['Range'] = 'bytes=' + str(received) + '-'
+                        tmp_headers['Range'] = 'bytes=' + str(received - chunk_start) + '-'
                         response = urlopen_with_retry(
                             request.Request(url, headers=tmp_headers)
                         )

When `url_save` is passed a list of urls (`is_chunked = True`), and the download is aborted, then the next time that you-get resumes the download, it will append the video data from beginning to the `.download` file, because it does not send a correct `Range` header when resuming.

Several "exceeding 100%" issues might be related to this: #2703, #2768

Steps to reproduce:
1. `you-get "https://www.youtube.com/watch?v=Y8Tko2YC5hA"`
2. Press `Ctrl-C` before the download is finished
3. Re-start the `you-get` command
3. The downloaded size will eventually exceed the expected file size and some merging error will appear

<details>
  <summary>The transcript for the steps</summary>
  
```
~/test > you-get "https://www.youtube.com/watch?v=Y8Tko2YC5hA"
site:                YouTube
title:               What is Python and Why You Must Learn It in [2019]
stream:
    - itag:          248
      container:     webm
      quality:       1920x1080 (1080p)
      size:          17.3 MiB (18168269 bytes)
    # download-with: you-get --itag=248 [URL]

Downloading What is Python and Why You Must Learn It in (2019).webm ...
53.4% (  9.2/ 17.3MB) ├███████████████████████████████████████████████████████████████████───────────────────────────────────────────────────────────┤[1/2]   13 MB/s^C¶
~/test (1) > you-get "https://www.youtube.com/watch?v=Y8Tko2YC5hA"
site:                YouTube
title:               What is Python and Why You Must Learn It in [2019]
stream:
    - itag:          248
      container:     webm
      quality:       1920x1080 (1080p)
      size:          17.3 MiB (18168269 bytes)
    # download-with: you-get --itag=248 [URL]

Downloading What is Python and Why You Must Learn It in (2019).webm ...
 100% ( 23.4/ 17.3MB) ├██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████┤[2/2]   11 MB/s
Merging video parts... Merging without re-encode failed.
Try again re-encoding audio... Merged into What is Python and Why You Must Learn It in (2019).webm

Saving What is Python and Why You Must Learn It in (2019).en.srt ... Done.
```
</details>

Basically, the idea of this pull request is to maintain the starting and ending offset for each chunk. And when resuming, it skips downloaded chunks by comparing the file size and ending offsets, and computes the correct `Range` for the first unfinished chunk.