Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] Cleanup for 2024-05 release #9765

Merged
merged 19 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ codetest:
flake8 .

test:
$(PYTHON) -m pytest
$(PYTHON) -m pytest -Werror
$(MAKE) codetest

offlinetest: codetest
$(PYTHON) -m pytest -k "not download"
$(PYTHON) -m pytest -Werror -m "not download"

CODE_FOLDERS_CMD = find yt_dlp -type f -name '__init__.py' | sed 's,/__init__.py,,' | grep -v '/__' | sort
CODE_FOLDERS != $(CODE_FOLDERS_CMD)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ File|Description
[yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Win7 SP1+) standalone x86 (32-bit) binary
[yt-dlp_min.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_min.exe)|Windows (Win7 SP1+) standalone x64 binary built with `py2exe`<br/> ([Not recommended](#standalone-py2exe-builds-windows))
[yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary
[yt-dlp_linux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux.zip)|Unpackaged Linux executable (no auto-update)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we dropping it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mamba build suddenly didnt want to work anymore and so we had to switch to a different strategy (statically linked musl libc builds). I have a plan to potentially bring them back but it will require some research and some trial and error. Bringing back working builds seemed of more immediate importance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen the discussion. But the zip build will be the same workflow with pyinstaller --one-dir, no? Sure, fixing it is not a priority, but I thought it'd be trivial

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a good overview of what staticx does: JonathonReinhart/staticx#239 (comment)

It works similarly to pyinstaller --onefile; it's just another layer of bundling on top with some RPATH+INTERP special sauce. The maintainer also says here that it's not possible to use staticx with pyinstaller --onedir builds, so we would need to get very inventive to prove them wrong(?)

Copy link
Member

@bashonly bashonly May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On that note, I think the static exe is a bit problematic since we are doubling the startup time and /tmp usage. I want to try replacing the linux_arm job with a CentOS 7 build flow; if that's successful, and if we can't find a way to optimize the static exe, then maybe we could build the linux_exe using the CentOS 7 framework as well.

[yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary
[yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary
[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows executable (no auto-update)
Expand Down
2 changes: 1 addition & 1 deletion test/test_InfoExtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ def test_search_nextjs_data(self):
self.assertEqual(self.ie._search_nextjs_data('', None, fatal=False), {})
self.assertEqual(self.ie._search_nextjs_data('', None, default=None), None)
self.assertEqual(self.ie._search_nextjs_data('', None, default={}), {})
with self.assertRaises(DeprecationWarning):
with self.assertWarns(DeprecationWarning):
self.assertEqual(self.ie._search_nextjs_data('', None, default='{}'), {})


Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/extractor/ceskatelevize.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _real_extract(self, url):
site_name = self._og_search_property('site_name', webpage, fatal=False, default='Česká televize')
playlist_title = self._og_search_title(webpage, default=None)
if site_name and playlist_title:
playlist_title = re.split(r'\s*[—|]\s*%s' % (site_name, ), playlist_title, 1)[0]
playlist_title = re.split(r'\s*[—|]\s*%s' % (site_name, ), playlist_title, maxsplit=1)[0]
playlist_description = self._og_search_description(webpage, default=None)
if playlist_description:
playlist_description = playlist_description.replace('\xa0', ' ')
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3526,7 +3526,7 @@ def _parse_jwplayer_formats(self, jwplayer_sources_data, video_id=None,
# See com/longtailvideo/jwplayer/media/RTMPMediaProvider.as
# of jwplayer.flash.swf
rtmp_url_parts = re.split(
r'((?:mp4|mp3|flv):)', source_url, 1)
r'((?:mp4|mp3|flv):)', source_url, maxsplit=1)
if len(rtmp_url_parts) == 3:
rtmp_url, prefix, play_path = rtmp_url_parts
a_format.update({
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/extractor/thisvid.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def _make_playlist_result(self, url):
title = re.split(
r'(?i)\s*\|\s*ThisVid\.com\s*$',
self._og_search_title(webpage, default=None)
or self._html_search_regex(r'(?s)<title\b[^>]*>(.+?)</title', webpage, 'title', fatal=False) or '', 1)[0] or None
or self._html_search_regex(r'(?s)<title\b[^>]*>(.+?)</title', webpage, 'title', fatal=False) or '', maxsplit=1)[0] or None

return self.playlist_from_matches(
self._generate_playlist_entries(url, playlist_id, webpage),
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@ def fixup(url):
return False
# "#" cannot be stripped out since it is part of the URI
# However, it can be safely stripped out if following a whitespace
return re.split(r'\s#', url, 1)[0].rstrip()
return re.split(r'\s#', url, maxsplit=1)[0].rstrip()

with contextlib.closing(batch_fd) as fd:
return [url for url in map(fixup, fd) if url]
Expand Down