Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libre
youtube-dl
Commits
50e9fcc1
Unverified
Commit
50e9fcc1
authored
Sep 06, 2020
by
Sergey M․
Browse files
[nrktv:episode] Improve video id extraction (closes #25594, closes #26369, closes #26409)
parent
16ee69c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
youtube_dl/extractor/nrk.py
View file @
50e9fcc1
...
...
@@ -11,7 +11,6 @@ from ..compat import (
from
..utils
import
(
ExtractorError
,
int_or_none
,
JSON_LD_RE
,
js_to_json
,
NO_DEFAULT
,
parse_age_limit
,
...
...
@@ -425,13 +424,20 @@ class NRKTVEpisodeIE(InfoExtractor):
webpage
=
self
.
_download_webpage
(
url
,
display_id
)
nrk_id
=
self
.
_parse_json
(
self
.
_search_regex
(
JSON_LD_RE
,
webpage
,
'JSON-LD'
,
group
=
'json_ld'
),
display_id
)[
'@id'
]
info
=
self
.
_search_json_ld
(
webpage
,
display_id
,
default
=
{})
nrk_id
=
info
.
get
(
'@id'
)
or
self
.
_html_search_meta
(
'nrk:program-id'
,
webpage
,
default
=
None
)
or
self
.
_search_regex
(
r
'data-program-id=["\'](%s)'
%
NRKTVIE
.
_EPISODE_RE
,
webpage
,
'nrk id'
)
assert
re
.
match
(
NRKTVIE
.
_EPISODE_RE
,
nrk_id
)
return
self
.
url_result
(
'nrk:%s'
%
nrk_id
,
ie
=
NRKIE
.
ie_key
(),
video_id
=
nrk_id
)
info
.
update
({
'_type'
:
'url_transparent'
,
'id'
:
nrk_id
,
'url'
:
'nrk:%s'
%
nrk_id
,
'ie_key'
:
NRKIE
.
ie_key
(),
})
return
info
class
NRKTVSerieBaseIE
(
InfoExtractor
):
...
...
Write
Preview
Supports
Markdown
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