about summary refs log tree commit diff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-02-08 01:08:48 +0700
committerSergey M․ <dstftw@gmail.com>2019-02-08 01:08:48 +0700
commit1211bb6dace4773f67bbf46b8944317679573a1f (patch)
treecca50fe3d07cb5b1b7d9ab62f65e86f58678c512 /youtube_dl/YoutubeDL.py
parent4de3cb883c61eeec56d8d271375a0624d481ad37 (diff)
downloadyoutube-dl-1211bb6dace4773f67bbf46b8944317679573a1f.tar.gz
youtube-dl-1211bb6dace4773f67bbf46b8944317679573a1f.tar.xz
youtube-dl-1211bb6dace4773f67bbf46b8944317679573a1f.zip
[YoutubeDL] Improve _make_archive_id (closes #19149)
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-xyoutube_dl/YoutubeDL.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index c168415ce..bc9fc270c 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -82,6 +82,7 @@ from .utils import (
     sanitize_url,
     sanitized_Request,
     std_headers,
+    str_or_none,
     subtitles_filename,
     UnavailableVideoError,
     url_basename,
@@ -2067,9 +2068,12 @@ class YoutubeDL(object):
         # and backwards compatibility with prior versions
         extractor = info_dict.get('extractor_key') or info_dict.get('ie_key')  # key in a playlist
         if extractor is None:
+            url = str_or_none(info_dict.get('url'))
+            if not url:
+                return
             # Try to find matching extractor for the URL and take its ie_key
             for ie in self._ies:
-                if ie.suitable(info_dict['url']):
+                if ie.suitable(url):
                     extractor = ie.ie_key()
                     break
             else: