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

Downloading entire season on NRK broken (patch included) #17258

Closed
5 tasks done
forthrin opened this issue Aug 16, 2018 · 4 comments
Closed
5 tasks done

Downloading entire season on NRK broken (patch included) #17258

forthrin opened this issue Aug 16, 2018 · 4 comments

Comments

@forthrin
Copy link

  • I've verified and I assure that I'm running youtube-dl 2018.08.04
  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser
  • Bug report (encountered problems with youtube-dl)

Downloading all episodes in a season in a series on NRK doesn't work.

$ youtube-dl --verbose https://tv.nrk.no/serie/zombielars/sesong/1
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'https://tv.nrk.no/serie/zombielars/sesong/1']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.08.04
[debug] Python version 2.7.15 (CPython) - Darwin-16.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.0.1, ffprobe 4.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[NRKTVSeason] 1: Downloading webpage
ERROR: Unable to extract config; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 792, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 502, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/nrk.py", line 450, in _real_extract
    series = self._extract_series(webpage, display_id)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/nrk.py", line 407, in _extract_series
    default='{}' if not fatal else NO_DEFAULT),
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 972, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract config; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
@forthrin
Copy link
Author

forthrin commented Aug 16, 2018

diff --git a/youtube_dl/extractor/nrk.py b/youtube_dl/extractor/nrk.py
index a231735fb..06802f586 100644
--- a/youtube_dl/extractor/nrk.py
+++ b/youtube_dl/extractor/nrk.py
@@ -404 +404 @@ class NRKTVSerieBaseIE(InfoExtractor):
-        config = self._parse_json(
+        initial = self._parse_json(
@@ -406 +406 @@ class NRKTVSerieBaseIE(InfoExtractor):
-                r'({.+?})\s*,\s*"[^"]+"\s*\)\s*</script>', webpage, 'config',
+                r'window.__NRK_TV_SERIES_INITIAL_DATA__ = ({.*});', webpage, 'initial',
@@ -408,0 +409 @@ class NRKTVSerieBaseIE(InfoExtractor):
+        config = initial['initialState']

@sulark
Copy link

sulark commented Oct 4, 2018

@forthrin Patch working for series where all episodes are available, but quits if some has expired rights

Regading issues: #17159 and patched suggested here.

Tried this patch, it's working if all epsiodes are still available in series.
But if only some, and by that I mean that maybe not the 1st and 2nd epsiode is available anymore, but only like episode 5 and 43, they will not be downloaded, cause the program quits after first failure of expired rights.

Output from a series where epsiode 1-7 is not longer available (due to rights)
And where episode 8-20 is still available.
We need the program to skip epsiodes that gives the message "Programmet har gått ut" and move on to try download the next episode.
Now the programs just exits, see code below:

UBUNTU# youtube-dl --yes-playlist https://tv.nrk.no/serie/thomas-og-vennene-hans [NRKTVSeries] thomas-og-vennene-hans: Downloading webpage [download] Downloading playlist: Thomas og vennene hans [NRKTVSeries] playlist Thomas og vennene hans: Collected 46 video ids (downloading 46 of them) [download] Downloading video 1 of 46 [NRK] MSUI21004115: Downloading mediaelement JSON ERROR: NRK said: Programmet har gått ut UBUNTU#

Output from a series where 5 of 5 epsiodes in series are available:

UBUNTU# youtube-dl --yes-playlist https://tv.nrk.no/serie/uten-pappa [NRKTVSeries] uten-pappa: Downloading webpage [download] Downloading playlist: Uten pappa [NRKTVSeries] playlist Uten pappa: Collected 5 video ids (downloading 5 of them) [download] Downloading video 1 of 5 [NRK] MYNT13000118: Downloading mediaelement JSON [NRK] MYNT13000118: Downloading f4m manifest [NRK] MYNT13000118: Downloading m3u8 information [download] Downloading playlist: Uten pappa 1:5 [NRK] playlist Uten pappa 1:5: Collected 1 video ids (downloading 1 of them) [download] Downloading video 1 of 1 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 158 [download] Destination: Uten pappa 1_5-MYNT13000118AA.mp4 [download] 100% of 467.96MiB in 00:15 [ffmpeg] Fixing malformed AAC bitstream in "Uten pappa 1_5-MYNT13000118AA.mp4" [download] Finished downloading playlist: Uten pappa 1:5 [download] Downloading video 2 of 5 [NRK] MYNT13000218: Downloading mediaelement JSON [NRK] MYNT13000218: Downloading f4m manifest [NRK] MYNT13000218: Downloading m3u8 information [download] Downloading playlist: Uten pappa 2:5 [NRK] playlist Uten pappa 2:5: Collected 1 video ids (downloading 1 of them) [download] Downloading video 1 of 1 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 139 [download] Destination: Uten pappa 2_5-MYNT13000218AA.mp4 [download] 100% of 411.37MiB in 00:13 [ffmpeg] Fixing malformed AAC bitstream in "Uten pappa 2_5-MYNT13000218AA.mp4" [download] Finished downloading playlist: Uten pappa 2:5 [download] Downloading video 3 of 5 [NRK] MYNT13000318: Downloading mediaelement JSON [NRK] MYNT13000318: Downloading f4m manifest [NRK] MYNT13000318: Downloading m3u8 information [download] Downloading playlist: Uten pappa 3:5 [NRK] playlist Uten pappa 3:5: Collected 1 video ids (downloading 1 of them) [download] Downloading video 1 of 1 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 149 [download] Destination: Uten pappa 3_5-MYNT13000318AA.mp4 [download] 100% of 439.15MiB in 00:14 [ffmpeg] Fixing malformed AAC bitstream in "Uten pappa 3_5-MYNT13000318AA.mp4" [download] Finished downloading playlist: Uten pappa 3:5 [download] Downloading video 4 of 5 [NRK] MYNT13000418: Downloading mediaelement JSON [NRK] MYNT13000418: Downloading f4m manifest [NRK] MYNT13000418: Downloading m3u8 information [download] Downloading playlist: Uten pappa 4:5 [NRK] playlist Uten pappa 4:5: Collected 1 video ids (downloading 1 of them) [download] Downloading video 1 of 1 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 149 [download] Destination: Uten pappa 4_5-MYNT13000418AA.mp4 [download] 100% of 439.38MiB in 00:14 [ffmpeg] Fixing malformed AAC bitstream in "Uten pappa 4_5-MYNT13000418AA.mp4" [download] Finished downloading playlist: Uten pappa 4:5 [download] Downloading video 5 of 5 [NRK] MYNT13000518: Downloading mediaelement JSON [NRK] MYNT13000518: Downloading f4m manifest [NRK] MYNT13000518: Downloading m3u8 information [download] Downloading playlist: Uten pappa 5:5 [NRK] playlist Uten pappa 5:5: Collected 1 video ids (downloading 1 of them) [download] Downloading video 1 of 1 [hlsnative] Downloading m3u8 manifest [hlsnative] Total fragments: 174 [download] Destination: Uten pappa 5_5-MYNT13000518BA.mp4 [download] 100% of 515.39MiB in 00:17 [ffmpeg] Fixing malformed AAC bitstream in "Uten pappa 5_5-MYNT13000518BA.mp4" [download] Finished downloading playlist: Uten pappa 5:5 [download] Finished downloading playlist: Uten pappa UBUNTU#

@remitamine
Copy link
Collaborator

@bombaaa

-i, --ignore-errors              Continue on download errors, for example to
                                 skip unavailable videos in a playlist

@sulark
Copy link

sulark commented Oct 5, 2018

@bombaaa

-i, --ignore-errors              Continue on download errors, for example to
                                 skip unavailable videos in a playlist

Embarrassed :S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants