Skip to content

Commit

Permalink
[cleanup] Misc (#8510)
Browse files Browse the repository at this point in the history
Authored by: bashonly, coletdjnz, dirkf, gamer191, seproDev, Grub4K
  • Loading branch information
Grub4K committed Nov 14, 2023
1 parent f04b5be commit b012271
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 21 deletions.
6 changes: 0 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -40,10 +40,4 @@ Fixes #
- [ ] Core bug fix/improvement
- [ ] New feature (It is strongly [recommended to open an issue first](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#adding-new-feature-or-making-overarching-changes))


<!-- Do NOT edit/remove anything below this! -->
</details><details><summary>Copilot Summary</summary>

copilot:all

</details>
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -163,10 +163,10 @@ Some of yt-dlp's default options are different from that of youtube-dl and youtu
For ease of use, a few more compat options are available:

* `--compat-options all`: Use all compat options (Do NOT use)
* `--compat-options youtube-dl`: Same as `--compat-options all,-multistreams,-playlist-match-filter`
* `--compat-options youtube-dlc`: Same as `--compat-options all,-no-live-chat,-no-youtube-channel-redirect,-playlist-match-filter`
* `--compat-options youtube-dl`: Same as `--compat-options all,-multistreams,-playlist-match-filter,-manifest-filesize-approx`
* `--compat-options youtube-dlc`: Same as `--compat-options all,-no-live-chat,-no-youtube-channel-redirect,-playlist-match-filter,-manifest-filesize-approx`
* `--compat-options 2021`: Same as `--compat-options 2022,no-certifi,filename-sanitization,no-youtube-prefer-utc-upload-date`
* `--compat-options 2022`: Same as `--compat-options playlist-match-filter,no-external-downloader-progress,prefer-legacy-http-handler`. Use this to enable all future compat options
* `--compat-options 2022`: Same as `--compat-options playlist-match-filter,no-external-downloader-progress,prefer-legacy-http-handler,manifest-filesize-approx`. Use this to enable all future compat options


# INSTALLATION
Expand Down
16 changes: 16 additions & 0 deletions devscripts/changelog_override.json
Expand Up @@ -98,5 +98,21 @@
"action": "add",
"when": "61bdf15fc7400601c3da1aa7a43917310a5bf391",
"short": "[priority] Security: [[CVE-2023-40581](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40581)] [Prevent RCE when using `--exec` with `%q` on Windows](https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-42h4-v29r-42qg)\n - The shell escape function is now using `\"\"` instead of `\\\"`.\n - `utils.Popen` has been patched to properly quote commands."
},
{
"action": "change",
"when": "8a8b54523addf46dfd50ef599761a81bc22362e6",
"short": "[rh:requests] Add handler for `requests` HTTP library (#3668)\n\n\tAdds support for HTTPS proxies and persistent connections (keep-alive)",
"authors": ["bashonly", "coletdjnz", "Grub4K"]
},
{
"action": "add",
"when": "1d03633c5a1621b9f3a756f0a4f9dc61fab3aeaa",
"short": "[priority] **The release channels have been adjusted!**\n\t* [`master`](https://github.com/yt-dlp/yt-dlp-master-builds) builds are made after each push, containing the latest fixes (but also possibly bugs). This was previously the `nightly` channel.\n\t* [`nightly`](https://github.com/yt-dlp/yt-dlp-nightly-builds) builds are now made once a day, if there were any changes."
},
{
"action": "add",
"when": "f04b5bedad7b281bee9814686bba1762bae092eb",
"short": "[priority] Security: [[CVE-2023-46121](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46121)] Patch [Generic Extractor MITM Vulnerability via Arbitrary Proxy Injection](https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-3ch3-jhc6-5r8x)\n\t- Disallow smuggling of arbitary `http_headers`; extractors now only use specific headers"
}
]
4 changes: 2 additions & 2 deletions yt_dlp/extractor/la7.py
Expand Up @@ -208,9 +208,9 @@ class LA7PodcastIE(LA7PodcastEpisodeIE): # XXX: Do not subclass from concrete I
'url': 'https://www.la7.it/propagandalive/podcast',
'info_dict': {
'id': 'propagandalive',
'title': "Propaganda Live",
'title': 'Propaganda Live',
},
'playlist_count_min': 10,
'playlist_mincount': 10,
}]

def _real_extract(self, url):
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/extractor/redtube.py
Expand Up @@ -39,7 +39,7 @@ class RedTubeIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'http://www.redtube.com/%s' % video_id, video_id)
f'https://www.redtube.com/{video_id}', video_id)

ERRORS = (
(('video-deleted-info', '>This video has been removed'), 'has been removed'),
Expand Down
15 changes: 8 additions & 7 deletions yt_dlp/extractor/videoken.py
Expand Up @@ -11,6 +11,7 @@
ExtractorError,
InAdvancePagedList,
int_or_none,
remove_start,
traverse_obj,
update_url_query,
url_or_none,
Expand Down Expand Up @@ -39,11 +40,11 @@ def _create_slideslive_url(self, video_url, video_id, referer):
if not video_url and not video_id:
return
elif not video_url or 'embed/sign-in' in video_url:
video_url = f'https://slideslive.com/embed/{video_id.lstrip("slideslive-")}'
video_url = f'https://slideslive.com/embed/{remove_start(video_id, "slideslive-")}'
if url_or_none(referer):
return update_url_query(video_url, {
'embed_parent_url': referer,
'embed_container_origin': f'https://{urllib.parse.urlparse(referer).netloc}',
'embed_container_origin': f'https://{urllib.parse.urlparse(referer).hostname}',
})
return video_url

Expand All @@ -57,12 +58,12 @@ def _extract_videos(self, videos, url):
video_url = video_id
ie_key = 'Youtube'
else:
video_url = traverse_obj(video, 'embed_url', 'embeddableurl')
if urllib.parse.urlparse(video_url).netloc == 'slideslive.com':
video_url = traverse_obj(video, 'embed_url', 'embeddableurl', expected_type=url_or_none)
if not video_url:
continue
elif urllib.parse.urlparse(video_url).hostname == 'slideslive.com':
ie_key = SlidesLiveIE
video_url = self._create_slideslive_url(video_url, video_id, url)
if not video_url:
continue
yield self.url_result(video_url, ie_key, video_id)


Expand Down Expand Up @@ -178,7 +179,7 @@ def _real_extract(self, url):
return self.url_result(
self._create_slideslive_url(None, video_id, url), SlidesLiveIE, video_id)
elif re.match(r'^[\w-]{11}$', video_id):
self.url_result(video_id, 'Youtube', video_id)
return self.url_result(video_id, 'Youtube', video_id)
else:
raise ExtractorError('Unable to extract without VideoKen API response')

Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/extractor/youtube.py
Expand Up @@ -6687,7 +6687,7 @@ class YoutubePlaylistIE(InfoExtractor):
'uploader_url': 'https://www.youtube.com/@milan5503',
'availability': 'public',
},
'expected_warnings': [r'[Uu]navailable videos? (is|are|will be) hidden'],
'expected_warnings': [r'[Uu]navailable videos? (is|are|will be) hidden', 'Retrying', 'Giving up'],
}, {
'url': 'http://www.youtube.com/embed/_xDOZElKyNU?list=PLsyOSbh5bs16vubvKePAQ1x3PhKavfBIl',
'playlist_mincount': 455,
Expand Down
3 changes: 2 additions & 1 deletion yt_dlp/networking/_requests.py
Expand Up @@ -255,7 +255,8 @@ def __init__(self, *args, **kwargs):
handler.setFormatter(logging.Formatter('requests: %(message)s'))
handler.addFilter(Urllib3LoggingFilter())
logger.addHandler(handler)
logger.setLevel(logging.WARNING)
# TODO: Use a logger filter to suppress pool reuse warning instead
logger.setLevel(logging.ERROR)

if self.verbose:
# Setting this globally is not ideal, but is easier than hacking with urllib3.
Expand Down

0 comments on commit b012271

Please sign in to comment.