Package: youtube-dl Followup-For: Bug #930462 Dear Maintainer,
This bug still affects the version in stable. The patch to fix it is tiny; would you consider backporting it? https://github.com/ytdl-org/youtube-dl/commit/027ffdca0d3174963a4269ce8de8519cfed7a12c The attached debdiff fixes this bug and one other annoying issue. I prepared and tested it on a stable system. I would be happy to handle the paperwork for a stable update if you would be willing to sponsor the actual upload.
diff -Nru youtube-dl-2019.01.17/debian/changelog youtube-dl-2019.01.17/debian/changelog --- youtube-dl-2019.01.17/debian/changelog 2019-04-27 14:03:56.000000000 -0700 +++ youtube-dl-2019.01.17/debian/changelog 2019-10-09 18:38:54.000000000 -0700 @@ -1,3 +1,12 @@ +youtube-dl (2019.01.17-1.1+deb10u1) buster; urgency=medium + + * Non-maintainer upload. + * Add upstream patch to fix 403 Forbidden errors on some YouTube videos. + (Closes: #930462) + * Add upstream patch to fix YouTube video titles not being extracted. + + -- Ryan Tandy <r...@nardis.ca> Thu, 10 Oct 2019 01:38:54 +0000 + youtube-dl (2019.01.17-1.1) unstable; urgency=medium [ Salvatore Bonaccorso ] diff -Nru youtube-dl-2019.01.17/debian/patches/series youtube-dl-2019.01.17/debian/patches/series --- youtube-dl-2019.01.17/debian/patches/series 2019-04-27 14:03:56.000000000 -0700 +++ youtube-dl-2019.01.17/debian/patches/series 2019-10-09 18:38:54.000000000 -0700 @@ -1,3 +1,5 @@ skip_support_file_installation.patch disable-autoupdate-mechanism.patch youtube-Fix-extraction.patch +youtube-Use-sp-field-value-for-signature-field-name.patch +youtube-improve-title-and-description-extraction.patch diff -Nru youtube-dl-2019.01.17/debian/patches/youtube-improve-title-and-description-extraction.patch youtube-dl-2019.01.17/debian/patches/youtube-improve-title-and-description-extraction.patch --- youtube-dl-2019.01.17/debian/patches/youtube-improve-title-and-description-extraction.patch 1969-12-31 16:00:00.000000000 -0800 +++ youtube-dl-2019.01.17/debian/patches/youtube-improve-title-and-description-extraction.patch 2019-10-09 18:38:54.000000000 -0700 @@ -0,0 +1,49 @@ +From 8dbf751aa241475dd8a7a6d3040713b5874fd057 Mon Sep 17 00:00:00 2001 +From: Remita Amine <remitam...@gmail.com> +Date: Tue, 30 Jul 2019 00:13:33 +0100 +Subject: [PATCH] [youtube] improve title and description extraction(closes + #21934) + +--- + youtube_dl/extractor/youtube.py | 15 +++------------ + 1 file changed, 3 insertions(+), 12 deletions(-) + +diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py +index b2c714505..9a182fcf6 100644 +--- a/youtube_dl/extractor/youtube.py ++++ b/youtube_dl/extractor/youtube.py +@@ -1820,16 +1820,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor): + video_details = try_get( + player_response, lambda x: x['videoDetails'], dict) or {} + +- # title +- if 'title' in video_info: +- video_title = video_info['title'][0] +- elif 'title' in player_response: +- video_title = video_details['title'] +- else: ++ video_title = video_info.get('title', [None])[0] or video_details.get('title') ++ if not video_title: + self._downloader.report_warning('Unable to extract video title') + video_title = '_' + +- # description + description_original = video_description = get_element_by_id("eow-description", video_webpage) + if video_description: + +@@ -1854,11 +1849,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): + ''', replace_url, video_description) + video_description = clean_html(video_description) + else: +- fd_mobj = re.search(r'<meta name="description" content="([^"]+)"', video_webpage) +- if fd_mobj: +- video_description = unescapeHTML(fd_mobj.group(1)) +- else: +- video_description = '' ++ video_description = self._html_search_meta('description', video_webpage) or video_details.get('shortDescription') + + if not smuggled_data.get('force_singlefeed', False): + if not self._downloader.params.get('noplaylist'): +-- +2.20.1 + diff -Nru youtube-dl-2019.01.17/debian/patches/youtube-Use-sp-field-value-for-signature-field-name.patch youtube-dl-2019.01.17/debian/patches/youtube-Use-sp-field-value-for-signature-field-name.patch --- youtube-dl-2019.01.17/debian/patches/youtube-Use-sp-field-value-for-signature-field-name.patch 1969-12-31 16:00:00.000000000 -0800 +++ youtube-dl-2019.01.17/debian/patches/youtube-Use-sp-field-value-for-signature-field-name.patch 2019-10-09 18:38:54.000000000 -0700 @@ -0,0 +1,27 @@ +From 027ffdca0d3174963a4269ce8de8519cfed7a12c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sergey=20M=E2=80=A4?= <dst...@gmail.com> +Date: Fri, 10 May 2019 08:36:10 +0700 +Subject: [PATCH] [youtube] Use sp field value for signature field name (closes + #18841, closes #18927, closes #21028) + +--- + youtube_dl/extractor/youtube.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py +index da202b9bc..8619f3838 100644 +--- a/youtube_dl/extractor/youtube.py ++++ b/youtube_dl/extractor/youtube.py +@@ -1987,7 +1987,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor): + + signature = self._decrypt_signature( + encrypted_sig, video_id, player_url, age_gate) +- url += '&signature=' + signature ++ sp = try_get(url_data, lambda x: x['sp'][0], compat_str) or 'signature' ++ url += '&%s=%s' % (sp, signature) + if 'ratebypass' not in url: + url += '&ratebypass=yes' + +-- +2.20.1 +