From: Rogério Brito Date: Wed, 17 Jun 2020 18:11:21 +0000 (-0300) Subject: New upstream version 2020.06.16.1 X-Git-Url: https://git.rapsys.eu/youtubedl/commitdiff_plain/8593410c28e395b68b410169356663541005c3ae?ds=sidebyside;hp=-c New upstream version 2020.06.16.1 --- 8593410c28e395b68b410169356663541005c3ae diff --git a/ChangeLog b/ChangeLog index 234fcc5..07d6ccd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +version 2020.06.16.1 + +Extractors +* [youtube] Force old layout (#25682, #25683, #25680, #25686) +* [youtube] Fix categories and improve tags extraction + + version 2020.06.16 Extractors diff --git a/youtube-dl b/youtube-dl index 359581f..a806646 100755 Binary files a/youtube-dl and b/youtube-dl differ diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index ce2212a..1bc79e0 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -77,7 +77,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor): def _set_language(self): self._set_cookie( - '.youtube.com', 'PREF', 'f1=50000000&hl=en', + '.youtube.com', 'PREF', 'f1=50000000&f6=8&hl=en', # YouTube sets the expire time to about two months expire_time=time.time() + 2 * 30 * 24 * 3600) @@ -2356,17 +2356,21 @@ class YoutubeIE(YoutubeBaseInfoExtractor): m_cat_container = self._search_regex( r'(?s)]*>\s*Category\s*\s*]*>(.*?)', video_webpage, 'categories', default=None) + category = None if m_cat_container: category = self._html_search_regex( r'(?s)(.*?)', m_cat_container, 'category', default=None) - video_categories = None if category is None else [category] - else: - video_categories = None + if not category: + category = try_get( + microformat, lambda x: x['category'], compat_str) + video_categories = None if category is None else [category] video_tags = [ unescapeHTML(m.group('content')) for m in re.finditer(self._meta_regex('og:video:tag'), video_webpage)] + if not video_tags: + video_tags = try_get(video_details, lambda x: x['keywords'], list) def _extract_count(count_name): return str_to_int(self._search_regex( diff --git a/youtube_dl/version.py b/youtube_dl/version.py index 56ed71c..6b88eb3 100644 --- a/youtube_dl/version.py +++ b/youtube_dl/version.py @@ -1,3 +1,3 @@ from __future__ import unicode_literals -__version__ = '2020.06.16' +__version__ = '2020.06.16.1'