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

MPEG-DASH download with auth parameter not working? #11175

Closed
3 tasks done
dimizuno opened this issue Nov 12, 2016 · 0 comments
Closed
3 tasks done

MPEG-DASH download with auth parameter not working? #11175

dimizuno opened this issue Nov 12, 2016 · 0 comments

Comments

@dimizuno
Copy link

  • I've verified and I assure that I'm running youtube-dl 2016.11.08.1
  • I at least skimmed through README and most notably FAQ and BUGS sections
  • I searched the bugtracker for similar issues including closed ones

What is the purpose of my issue?

  • [x ] Question

My favorite IPTV provider zattoo.com recently switched their streaming technology from Adobe HDS to MPEG-DASH. You can only access their content through a valid subscription (which is free) and an IP from one of the following countries: Switzerland, Germany, Spain, Denmark, UK. I used to start a video in the browser, pause it but leave the window open. That would create an authentication token and keep it valid, so I could download the HDS fragments from the command line using an external script.


Now that there is DASH implemented, I tried to use youtube-dl with the manifest URL:
> youtube-dl -v -f bestvideo+bestaudio http://zh2-2-dash-pvr.zahs.tv/HD_ard/1477757760/1477759800/manifest.mpd?z32=OVZWK4S7NFSD2MZUGUZTENZUEZWWS3TSMF2GKPJWGAYCM3LBPBZGC5DFHUYCM43JM46WMOBXMJSTEY3BGRSDMYJYGZRDCZJTMYYWKMZRGMZTONBUHAYDKOJGMNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTJNZUXI2LBNRZGC5DFHUYA
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-f', 'bestvideo+bestaudio', 'http://zh2-2-dash-pvr.zahs.tv/HD_ard/1477757760/1477759800/manifest.mpd?z32=OVZWK4S7NFSD2MZUGUZTENZUEZWWS3TSMF2GKPJWGAYCM3LBPBZGC5DFHUYCM43JM46WMOBXMJSTEY3BGRSDMYJYGZRDCZJTMYYWKMZRGMZTONBUHAYDKOJGMNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTJNZUXI2LBNRZGC5DFHUYA']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2016.11.08.1
[debug] Python version 3.4.4 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-74054-gb16b8c8, ffprobe N-74054-gb16b8c8
[debug] Proxy map: {}
[generic] manifest: Requesting header
WARNING: Falling back on generic information extractor.
[generic] manifest: Downloading webpage
[generic] manifest: Extracting information
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\__init__.py", line 445, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\__init__.py", line 435, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\YoutubeDL.py", line 1791, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\YoutubeDL.py", line 694, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\extractor\common.py", line 357, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\extractor\generic.py", line 1653, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\extractor\common.py", line 1735, in _parse_mpd_formats
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\extractor\common.py", line 1725, in add_segment_url
TypeError: %d format: a number is required, not str

That is what the manifest looks like:
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="urn:mpeg:dash:schema:mpd:2011"
 xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
 minBufferTime="PT1S"
 profiles="urn:mpeg:dash:profile:isoff-main:2011"
 type="static"
 mediaPresentationDuration="PT2040S">
  <Period duration="PT2040S" start="PT0S">
    <AdaptationSet id="0" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
      <SegmentTemplate presentationTimeOffset="0" media="video-time=$Time$-$Bandwidth$-0.m4s?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTNMF4HEYLUMU6TKMBQGATHK43FOJPWSZB5GM2DKMZSG42CM43JM46TGMC7MJSGKNBRMU4GGMZZMZSGGMTGGBQTMNJYMNRTCYRXMNQWKNLEHE3A" initialization="video-$Bandwidth$-0.mp4?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTNMF4HEYLUMU6TKMBQGATHK43FOJPWSZB5GM2DKMZSG42CM43JM46TGMC7MJSGKNBRMU4GGMZZMZSGGMTGGBQTMNJYMNRTCYRXMNQWKNLEHE3A" timescale="1000" >
        <SegmentTimeline>
          <S d="4000" r="509"/>
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation id="0" codecs="avc1.4d4020" width="1280" height="720" frameRate="50" bandwidth="4800000"/>
      <Representation id="1" codecs="avc1.4d401f" width="1280" height="720" frameRate="25" bandwidth="2800000"/>
      <Representation id="2" codecs="avc1.4d401e" width="768" height="432" frameRate="25" bandwidth="1300000"/>
      <Representation id="3" codecs="avc1.4d4015" width="512" height="288" frameRate="25" bandwidth="700000"/>
      <Representation id="4" codecs="avc1.4d4015" width="512" height="288" frameRate="25" bandwidth="500000"/>
    </AdaptationSet>
    <AdaptationSet id="1" lang="ger" mimeType="audio/mp4" codecs="mp4a.40.2" segmentAlignment="true" startWithSAP="1">
      <AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="2"/>
      <SegmentTemplate presentationTimeOffset="0" media="audio-time=$Time$-$Bandwidth$-0.m4s?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTOMF2GS5TFHU2TAMBQEZ2XGZLSL5UWIPJTGQ2TGMRXGQTHG2LHHUZTAX3GGUZWKNBSMNQWKYZXME4TIMDFGFQTCMTCME4GEYJUMQZGKYLFGU" initialization="audio-$Bandwidth$-0.mp4?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTOMF2GS5TFHU2TAMBQEZ2XGZLSL5UWIPJTGQ2TGMRXGQTHG2LHHUZTAX3GGUZWKNBSMNQWKYZXME4TIMDFGFQTCMTCME4GEYJUMQZGKYLFGU" timescale="1000" >
        <SegmentTimeline>
          <S d="3200" r="636"/>
          <S d="1600"/>
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation id="5" bandwidth="128000"/>
    </AdaptationSet>
    <AdaptationSet id="2" lang="mis" mimeType="audio/mp4" codecs="mp4a.40.2" segmentAlignment="true" startWithSAP="1">
      <AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="2"/>
      <SegmentTemplate presentationTimeOffset="0" media="audio-time=$Time$-$Bandwidth$-1.m4s?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTOMF2GS5TFHU2TAMBQEZ2XGZLSL5UWIPJTGQ2TGMRXGQTHG2LHHUZTAX3GGUZWKNBSMNQWKYZXME4TIMDFGFQTCMTCME4GEYJUMQZGKYLFGU" initialization="audio-$Bandwidth$-1.mp4?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTOMF2GS5TFHU2TAMBQEZ2XGZLSL5UWIPJTGQ2TGMRXGQTHG2LHHUZTAX3GGUZWKNBSMNQWKYZXME4TIMDFGFQTCMTCME4GEYJUMQZGKYLFGU" timescale="1000" >
        <SegmentTimeline>
          <S d="3200" r="636"/>
          <S d="1600"/>
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation id="6" bandwidth="128000"/>
    </AdaptationSet>
    <AdaptationSet id="3" lang="deu" mimeType="application/mp4" codecs="stpp">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
      <SegmentTemplate presentationTimeOffset="0" media="subs-time=$Time$-5000000-0.m4s?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTOMF2GS5TFHU2TAMBQEZ2XGZLSL5UWIPJTGQ2TGMRXGQTHG2LHHUZTAX3GGUZWKNBSMNQWKYZXME4TIMDFGFQTCMTCME4GEYJUMQZGKYLFGU" initialization="subs-5000000-0.mp4?z32=MNZWSZB5GE2DQNRWHFBEMNKDGRDDMM2CIEWTOMBVGNCECMKDHBATGRCFIRCTCJTOMF2GS5TFHU2TAMBQEZ2XGZLSL5UWIPJTGQ2TGMRXGQTHG2LHHUZTAX3GGUZWKNBSMNQWKYZXME4TIMDFGFQTCMTCME4GEYJUMQZGKYLFGU" timescale="1000" >
        <SegmentTimeline>
          <S d="4000" r="509"/>
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation id="7" bandwidth="100"/>
    </AdaptationSet>
  </Period>
</MPD>

For comparison I also tried it without the auth token:
> youtube-dl -v -f bestvideo+bestaudio http://zh2-2-dash-pvr.zahs.tv/HD_ard/1477757760/1477759800/manifest.mpd
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-f', 'bestvideo+bestaudio', 'http://zh2-2-dash-pvr.zahs.tv/HD_ard/1477757760/1477759800/manifest.mpd']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2016.11.08.1
[debug] Python version 3.4.4 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-74054-gb16b8c8, ffprobe N-74054-gb16b8c8
[debug] Proxy map: {}
[generic] manifest: Requesting header
WARNING: Could not send HEAD request to http://zh2-2-dash-pvr.zahs.tv/HD_ard/1477757760/1477759800/manifest.mpd: HTTP Error 401: Unauthorized
[generic] manifest: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 401: Unauthorized (caused by HTTPError()); 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.
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\extractor\common.py", line 404, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpee_sdt7t\build\youtube_dl\YoutubeDL.py", line 2001, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default

I am pretty sure that a download should be possible. Could you please tell me what I am doing wrong?

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

1 participant