Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backups
youtube-dl
Commits
1c821227
Unverified
Commit
1c821227
authored
Dec 17, 2018
by
Sergey M․
Browse files
[ard:beta] Relax _VALID_URL (closes #18441)
parent
50a498a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
youtube_dl/extractor/ard.py
youtube_dl/extractor/ard.py
+12
-2
No files found.
youtube_dl/extractor/ard.py
View file @
1c821227
...
...
@@ -56,6 +56,10 @@ class ARDMediathekIE(InfoExtractor):
'only_matching'
:
True
,
}]
@
classmethod
def
suitable
(
cls
,
url
):
return
False
if
ARDBetaMediathekIE
.
suitable
(
url
)
else
super
(
ARDMediathekIE
,
cls
).
suitable
(
url
)
def
_extract_media_info
(
self
,
media_info_url
,
webpage
,
video_id
):
media_info
=
self
.
_download_json
(
media_info_url
,
video_id
,
'Downloading media JSON'
)
...
...
@@ -296,7 +300,7 @@ class ARDIE(InfoExtractor):
class
ARDBetaMediathekIE
(
InfoExtractor
):
_VALID_URL
=
r
'https://beta\.ardmediathek\.de/[
a-z]+/player
/(?P<video_id>[a-zA-Z0-9]+)/(?P<display_id>[^/?#]+)'
_VALID_URL
=
r
'https://
(?:
beta
|www)
\.ardmediathek\.de/[
^/]+/(?:player|live)
/(?P<video_id>[a-zA-Z0-9]+)
(?:
/(?P<display_id>[^/?#]+)
)?
'
_TESTS
=
[{
'url'
:
'https://beta.ardmediathek.de/ard/player/Y3JpZDovL2Rhc2Vyc3RlLmRlL3RhdG9ydC9mYmM4NGM1NC0xNzU4LTRmZGYtYWFhZS0wYzcyZTIxNGEyMDE/die-robuste-roswita'
,
'md5'
:
'2d02d996156ea3c397cfc5036b5d7f8f'
,
...
...
@@ -310,12 +314,18 @@ class ARDBetaMediathekIE(InfoExtractor):
'upload_date'
:
'20180826'
,
'ext'
:
'mp4'
,
},
},
{
'url'
:
'https://www.ardmediathek.de/ard/player/Y3JpZDovL3N3ci5kZS9hZXgvbzEwNzE5MTU/'
,
'only_matching'
:
True
,
},
{
'url'
:
'https://www.ardmediathek.de/swr/live/Y3JpZDovL3N3ci5kZS8xMzQ4MTA0Mg'
,
'only_matching'
:
True
,
}]
def
_real_extract
(
self
,
url
):
mobj
=
re
.
match
(
self
.
_VALID_URL
,
url
)
video_id
=
mobj
.
group
(
'video_id'
)
display_id
=
mobj
.
group
(
'display_id'
)
display_id
=
mobj
.
group
(
'display_id'
)
or
video_id
webpage
=
self
.
_download_webpage
(
url
,
display_id
)
data_json
=
self
.
_search_regex
(
r
'window\.__APOLLO_STATE__\s*=\s*(\{.*);\n'
,
webpage
,
'json'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment