diff --git a/.gitignore b/.gitignore
index 507ba8c7f..630c2e01f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,7 @@ cookies
*.gif
*.jpeg
*.jpg
+*.lrc
*.m4a
*.m4v
*.mhtml
@@ -40,6 +41,7 @@ cookies
*.mov
*.mp3
*.mp4
+*.mpg
*.mpga
*.oga
*.ogg
@@ -47,6 +49,7 @@ cookies
*.png
*.sbv
*.srt
+*.ssa
*.swf
*.swp
*.tt
diff --git a/Makefile b/Makefile
index 2cfeb7841..9344003f8 100644
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,8 @@ pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites \
clean-test:
rm -rf test/testdata/sigs/player-*.js tmp/ *.annotations.xml *.aria2 *.description *.dump *.frag \
*.frag.aria2 *.frag.urls *.info.json *.live_chat.json *.meta *.part* *.tmp *.temp *.unknown_video *.ytdl \
- *.3gp *.ape *.ass *.avi *.desktop *.f4v *.flac *.flv *.gif *.jpeg *.jpg *.m4a *.m4v *.mhtml *.mkv *.mov *.mp3 \
- *.mp4 *.mpga *.oga *.ogg *.opus *.png *.sbv *.srt *.swf *.swp *.tt *.ttml *.url *.vtt *.wav *.webloc *.webm *.webp
+ *.3gp *.ape *.ass *.avi *.desktop *.f4v *.flac *.flv *.gif *.jpeg *.jpg *.lrc *.m4a *.m4v *.mhtml *.mkv *.mov *.mp3 *.mp4 \
+ *.mpg *.mpga *.oga *.ogg *.opus *.png *.sbv *.srt *.ssa *.swf *.swp *.tt *.ttml *.url *.vtt *.wav *.webloc *.webm *.webp
clean-dist:
rm -rf yt-dlp.1.temp.md yt-dlp.1 README.txt MANIFEST build/ dist/ .coverage cover/ yt-dlp.tar.gz completions/ \
yt_dlp/extractor/lazy_extractors.py *.spec CONTRIBUTING.md.tmp yt-dlp yt-dlp.exe yt_dlp.egg-info/ AUTHORS
diff --git a/bundle/__init__.py b/bundle/__init__.py
index 932b79829..e69de29bb 100644
--- a/bundle/__init__.py
+++ b/bundle/__init__.py
@@ -1 +0,0 @@
-# Empty file
diff --git a/bundle/py2exe.py b/bundle/py2exe.py
index a7e4113f1..ccb52eaa2 100755
--- a/bundle/py2exe.py
+++ b/bundle/py2exe.py
@@ -20,7 +20,7 @@ def main():
'py2exe builds do not support pycryptodomex and needs VC++14 to run. '
'It is recommended to run "pyinst.py" to build using pyinstaller instead')
- return freeze(
+ freeze(
console=[{
'script': './yt_dlp/__main__.py',
'dest_base': 'yt-dlp',
diff --git a/devscripts/__init__.py b/devscripts/__init__.py
index 750dbdca7..e69de29bb 100644
--- a/devscripts/__init__.py
+++ b/devscripts/__init__.py
@@ -1 +0,0 @@
-# Empty file needed to make devscripts.utils properly importable from outside
diff --git a/devscripts/changelog_override.json b/devscripts/changelog_override.json
index 8c5286432..2a34ad071 100644
--- a/devscripts/changelog_override.json
+++ b/devscripts/changelog_override.json
@@ -120,5 +120,11 @@
"when": "15f22b4880b6b3f71f350c64d70976ae65b9f1ca",
"short": "[webvtt] Allow spaces before newlines for CueBlock (#7681)",
"authors": ["TSRBerry"]
+ },
+ {
+ "action": "change",
+ "when": "4ce57d3b873c2887814cbec03d029533e82f7db5",
+ "short": "[ie] Support multi-period MPD streams (#6654)",
+ "authors": ["alard", "pukkandan"]
}
]
diff --git a/devscripts/make_changelog.py b/devscripts/make_changelog.py
index 123eebc2a..faab5fa86 100644
--- a/devscripts/make_changelog.py
+++ b/devscripts/make_changelog.py
@@ -253,7 +253,7 @@ class CommitRange:
''', re.VERBOSE | re.DOTALL)
EXTRACTOR_INDICATOR_RE = re.compile(r'(?:Fix|Add)\s+Extractors?', re.IGNORECASE)
REVERT_RE = re.compile(r'(?:\[[^\]]+\]\s+)?(?i:Revert)\s+([\da-f]{40})')
- FIXES_RE = re.compile(r'(?i:Fix(?:es)?(?:\s+bugs?)?(?:\s+in|\s+for)?|Revert)\s+([\da-f]{40})')
+ FIXES_RE = re.compile(r'(?i:Fix(?:es)?(?:\s+bugs?)?(?:\s+in|\s+for)?|Revert|Improve)\s+([\da-f]{40})')
UPSTREAM_MERGE_RE = re.compile(r'Update to ytdl-commit-([\da-f]+)')
def __init__(self, start, end, default_author=None):
diff --git a/test/test_networking.py b/test/test_networking.py
index 10534242a..628f1f171 100644
--- a/test/test_networking.py
+++ b/test/test_networking.py
@@ -69,7 +69,7 @@ def _build_proxy_handler(name):
self.send_response(200)
self.send_header('Content-Type', 'text/plain; charset=utf-8')
self.end_headers()
- self.wfile.write('{self.proxy_name}: {self.path}'.format(self=self).encode())
+ self.wfile.write(f'{self.proxy_name}: {self.path}'.encode())
return HTTPTestRequestHandler
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 2ee9647a8..c34d97bba 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -575,7 +575,7 @@ class YoutubeDL:
'url', 'manifest_url', 'manifest_stream_number', 'ext', 'format', 'format_id', 'format_note',
'width', 'height', 'aspect_ratio', 'resolution', 'dynamic_range', 'tbr', 'abr', 'acodec', 'asr', 'audio_channels',
'vbr', 'fps', 'vcodec', 'container', 'filesize', 'filesize_approx', 'rows', 'columns',
- 'player_url', 'protocol', 'fragment_base_url', 'fragments', 'is_from_start',
+ 'player_url', 'protocol', 'fragment_base_url', 'fragments', 'is_from_start', 'is_dash_periods', 'request_data',
'preference', 'language', 'language_preference', 'quality', 'source_preference', 'cookies',
'http_headers', 'stretched_ratio', 'no_resume', 'has_drm', 'extra_param_to_segment_url', 'hls_aes', 'downloader_options',
'page_url', 'app', 'play_path', 'tc_url', 'flash_version', 'rtmp_live', 'rtmp_conn', 'rtmp_protocol', 'rtmp_real_time'
diff --git a/yt_dlp/extractor/altcensored.py b/yt_dlp/extractor/altcensored.py
index a8428ce2e..6878918a0 100644
--- a/yt_dlp/extractor/altcensored.py
+++ b/yt_dlp/extractor/altcensored.py
@@ -4,6 +4,7 @@ from .archiveorg import ArchiveOrgIE
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
+ clean_html,
int_or_none,
orderedSet,
str_to_int,
@@ -32,13 +33,15 @@ class AltCensoredIE(InfoExtractor):
'duration': 926.09,
'thumbnail': 'https://archive.org/download/youtube-k0srjLSkga8/youtube-k0srjLSkga8.thumbs/k0srjLSkga8_000925.jpg',
'view_count': int,
- 'categories': ['News & Politics'], # FIXME
+ 'categories': ['News & Politics'],
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
+ category = clean_html(self._html_search_regex(
+ r'([^<]+)', webpage, 'category', default=None))
return {
'_type': 'url_transparent',
@@ -46,9 +49,7 @@ class AltCensoredIE(InfoExtractor):
'ie_key': ArchiveOrgIE.ie_key(),
'view_count': str_to_int(self._html_search_regex(
r'YouTube Views:(?:\s| )*([\d,]+)', webpage, 'view count', default=None)),
- 'categories': self._html_search_regex(
- r'\s*\n?\s*([^<]+)',
- webpage, 'category', default='').split() or None,
+ 'categories': [category] if category else None,
}
diff --git a/yt_dlp/extractor/arte.py b/yt_dlp/extractor/arte.py
index 92b4900f9..1c180b1fd 100644
--- a/yt_dlp/extractor/arte.py
+++ b/yt_dlp/extractor/arte.py
@@ -142,10 +142,10 @@ class ArteTVIE(ArteTVBaseIE):
def _fix_accessible_subs_locale(subs):
updated_subs = {}
for lang, sub_formats in subs.items():
- for format in sub_formats:
- if format.get('url', '').endswith('-MAL.m3u8'):
+ for fmt in sub_formats:
+ if fmt.get('url', '').endswith('-MAL.m3u8'):
lang += '-acc'
- updated_subs.setdefault(lang, []).append(format)
+ updated_subs.setdefault(lang, []).append(fmt)
return updated_subs
def _real_extract(self, url):
diff --git a/yt_dlp/extractor/getcourseru.py b/yt_dlp/extractor/getcourseru.py
index 6fdbcd736..144321ad6 100644
--- a/yt_dlp/extractor/getcourseru.py
+++ b/yt_dlp/extractor/getcourseru.py
@@ -160,9 +160,8 @@ class GetCourseRuIE(InfoExtractor):
self._login(hostname, username, password)
display_id = self._match_id(url)
- # NB: 404 is returned due to yt-dlp not properly following redirects #9020
- webpage, urlh = self._download_webpage_handle(url, display_id, expected_status=404)
- if self._LOGIN_URL_PATH in urlh.url or urlh.status == 404:
+ webpage, urlh = self._download_webpage_handle(url, display_id)
+ if self._LOGIN_URL_PATH in urlh.url:
raise ExtractorError(
f'This video is only available for registered users. {self._login_hint("any", netrc=hostname)}',
expected=True)
diff --git a/yt_dlp/extractor/medaltv.py b/yt_dlp/extractor/medaltv.py
index eeb5b85f3..675ad8ccc 100644
--- a/yt_dlp/extractor/medaltv.py
+++ b/yt_dlp/extractor/medaltv.py
@@ -9,7 +9,6 @@ from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
- update_url_query,
)
@@ -82,7 +81,7 @@ class MedalTVIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
- webpage = self._download_webpage(update_url_query(url, {'mobilebypass': 'true'}), video_id)
+ webpage = self._download_webpage(url, video_id, query={'mobilebypass': 'true'})
hydration_data = self._search_json(
r'