aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2022-10-13 01:59:01 +0000
committerGitHub <noreply@github.com>2022-10-13 01:59:01 +0000
commit7135277fec497bd7649c31087aba52daa7897484 (patch)
treeaeafac0ccf542f94bc1f3a5bf73d114fce5ba0a9 /youtube_dl/extractor
parent7bbd5b13d4c6cfc3e24f56413ff1a1eace8472b8 (diff)
downloadyoutube-dl-7135277fec497bd7649c31087aba52daa7897484.tar.xz
[ManyVids] Support new single-page app structure
See https://github.com/yt-dlp/yt-dlp/issues/5210#issuecomment-1276919962.
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/manyvids.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/youtube_dl/extractor/manyvids.py b/youtube_dl/extractor/manyvids.py
index 6805102ba..608a02a8d 100644
--- a/youtube_dl/extractor/manyvids.py
+++ b/youtube_dl/extractor/manyvids.py
@@ -47,7 +47,12 @@ class ManyVidsIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
- webpage = self._download_webpage(url, video_id)
+ real_url = 'https://www.manyvids.com/video/%s/gtm.js' % (video_id, )
+ try:
+ webpage = self._download_webpage(real_url, video_id)
+ except:
+ # probably useless fallback
+ webpage = self._download_webpage(url, video_id)
info = self._search_regex(
r'''(<div\b[^>]*\bid\s*=\s*(['"])pageMetaDetails\2[^>]*>)''',
@@ -98,7 +103,8 @@ class ManyVidsIE(InfoExtractor):
# Sets some cookies
self._download_webpage(
'https://www.manyvids.com/includes/ajax_repository/you_had_me_at_hello.php',
- video_id, fatal=False, data=urlencode_postdata({
+ video_id, note='Setting format cookies', fatal=False,
+ data=urlencode_postdata({
'mvtoken': mv_token,
'vid': video_id,
}), headers={