projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Credit @EraYaN for vlive update (#8446)
[youtube-dl]
/
youtube_dl
/
downloader
/
dash.py
diff --git
a/youtube_dl/downloader/dash.py
b/youtube_dl/downloader/dash.py
index 8b6fa2753adbafcb1a0ab26788dcec2be5903638..b0070aeade03105fbad27b7ffb79cfd17c8df6bb 100644
(file)
--- a/
youtube_dl/downloader/dash.py
+++ b/
youtube_dl/downloader/dash.py
@@
-3,7
+3,7
@@
from __future__ import unicode_literals
import re
from .common import FileDownloader
import re
from .common import FileDownloader
-from ..
compat import compat_urllib_r
equest
+from ..
utils import sanitized_R
equest
class DashSegmentsFD(FileDownloader):
class DashSegmentsFD(FileDownloader):
@@
-22,7
+22,7
@@
class DashSegmentsFD(FileDownloader):
def append_url_to_file(outf, target_url, target_name, remaining_bytes=None):
self.to_screen('[DashSegments] %s: Downloading %s' % (info_dict['id'], target_name))
def append_url_to_file(outf, target_url, target_name, remaining_bytes=None):
self.to_screen('[DashSegments] %s: Downloading %s' % (info_dict['id'], target_name))
- req =
compat_urllib_request.
Request(target_url)
+ req =
sanitized_
Request(target_url)
if remaining_bytes is not None:
req.add_header('Range', 'bytes=0-%d' % (remaining_bytes - 1))
if remaining_bytes is not None:
req.add_header('Range', 'bytes=0-%d' % (remaining_bytes - 1))
@@
-40,9
+40,10
@@
class DashSegmentsFD(FileDownloader):
return '%s%s%s' % (base_url, '' if base_url.endswith('/') else '/', target_url)
with open(tmpfilename, 'wb') as outf:
return '%s%s%s' % (base_url, '' if base_url.endswith('/') else '/', target_url)
with open(tmpfilename, 'wb') as outf:
- append_url_to_file(
- outf, combine_url(base_url, info_dict['initialization_url']),
- 'initialization segment')
+ if info_dict.get('initialization_url'):
+ append_url_to_file(
+ outf, combine_url(base_url, info_dict['initialization_url']),
+ 'initialization segment')
for i, segment_url in enumerate(segment_urls):
segment_len = append_url_to_file(
outf, combine_url(base_url, segment_url),
for i, segment_url in enumerate(segment_urls):
segment_len = append_url_to_file(
outf, combine_url(base_url, segment_url),