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

[9Now] ERROR: Unable to extract policy key #15803

Closed
Pseudomocha opened this issue Mar 9, 2018 · 11 comments
Closed

[9Now] ERROR: Unable to extract policy key #15803

Pseudomocha opened this issue Mar 9, 2018 · 11 comments

Comments

@Pseudomocha
Copy link

@Pseudomocha Pseudomocha commented Mar 9, 2018

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.03.03. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.03.03

Before submitting an issue make sure you have:

  • 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

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

youtube-dl --verbose www.9now.com.au/married-at-first-sight/season-5/episode-23
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'www.9now.com.au/married-at-first-sight/season-5/episode-23']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.03
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.11-0ubuntu0.16.04.1, ffprobe 2.8.11-0ubuntu0.16.04.1, rtmpdump 2.4
[debug] Proxy map: {}
WARNING: The url doesn't specify the protocol, trying with http
[9now.com.au] episode-23: Downloading webpage
[brightcove:new] 5745633523001: Downloading webpage
ERROR: Unable to extract policy key; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how 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/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 785, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 440, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/brightcove.py", line 693, in _real_extract
    webpage, 'policy key', group='pk')
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 796, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract policy key; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.


Description of your issue, suggested solution and other information

Attempted to download video from www.9now.com.au and encountered the above error. The site is on the supported site list. I have tried the following:

  1. Different youtube-dl host
  2. Different network (4G internet + home broadband)
  3. Passing site credentials with -u and -p flags
  4. Passing cookies with the --cookies flag
  5. Passing cookies with the --cookies flag and site credentials with -u and -p flags

All attempts return the same error as above: ERROR: Unable to extract policy key.

Thanks in advance for your help :)

@section83
Copy link

@section83 section83 commented Mar 13, 2018

I've just downloaded that show with no problems (from within Australia).

Perhaps it was a transitory problem with the 9Now site. Make sure you give youtube-dl the full URL – your result seems to have been based on http whereas 9Now uses https.

You could also update ffmpeg and ffprobe to v3.4.2.

@Pseudomocha
Copy link
Author

@Pseudomocha Pseudomocha commented Mar 13, 2018

So I updated ffmpeg and ffprobe to 3.4.2-1, and still encounter the error on both ubuntu hosts, however, the same link works fine on my windows desktop. Happy to call this solved, since I can just spin up a windows VM if I want to automate my downloads. Thanks.

youtube-dl --verbose https://www.9now.com.au/married-at-first-sight/season-5/episode-23
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'https://www.9now.com.au/married-at-first-sight/season-5/episode-23']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.03
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 3.4.2-1, ffprobe 3.4.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[9now.com.au] episode-23: Downloading webpage
[brightcove:new] 5745633523001: Downloading webpage
ERROR: Unable to extract policy key; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how 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/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 785, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 440, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/brightcove.py", line 693, in _real_extract
    webpage, 'policy key', group='pk')
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 796, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract policy key; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@section83
Copy link

@section83 section83 commented Mar 13, 2018

Might be best to leave open in case there is an issue, although that seems unlikely – I'm using a copy from "yt-dl.org/downloads/latest/youtube-dl" on macOS without that problem. You might get a different result with the 2018.03.10 version. Are other downloads working ?

@Pseudomocha
Copy link
Author

@Pseudomocha Pseudomocha commented Mar 13, 2018

Updated to the latest version, still get the same error

youtube-dl -v https://www.9now.com.au/60-minutes/2018/episode-4
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.9now.com.au/60-minutes/2018/episode-4']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.10
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 3.4.2-1, ffprobe 3.4.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[9now.com.au] episode-4: Downloading webpage
[brightcove:new] 5749212503001: Downloading webpage
ERROR: Unable to extract policy key; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how 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/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 785, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 440, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/brightcove.py", line 693, in _real_extract
    webpage, 'policy key', group='pk')
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 796, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract policy key; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

I'm able to download videos from other sites like youtube

youtube-dl -v https://www.youtube.com/watch?v=B8K9jAJ3Ong
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=B8K9jAJ3Ong']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.10
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 3.4.2-1, ffprobe 3.4.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] B8K9jAJ3Ong: Downloading webpage
[youtube] B8K9jAJ3Ong: Downloading video info webpage
[youtube] B8K9jAJ3Ong: Extracting video information
[debug] Default format spec: bestvideo+bestaudio/best
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on u'https://r3---sn-v2u0n-hxaz.googlevideo.com/videoplayback?ipbits=0&pl=16&clen=22351199&requiressl=yes&mime=video%2Fmp4&expire=1520946797&pcm2cms=yes&c=WEB&initcwndbps=913750&aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&mm=31%2C29&signature=96E66E38D023A534AC180B6F631A7F3CAD77D7E2.7B3C0DFBB0B3410B53BFB6A3340FBBFC3E959771&mn=sn-v2u0n-hxaz%2Csn-ntq7yn7s&key=yt6&ip=49.177.75.23&dur=158.241&keepalive=yes&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cexpire&source=youtube&lmt=1518113253112501&ei=DXqnWvmlGs2W4AKO877IDA&id=o-ADN0zPteh9880L9AyqGW5DU3E7rwB4VY9Apnk0vJYj-z&ms=au%2Crdu&mt=1520925109&mv=m&fvip=1&itag=137&gir=yes&ratebypass=yes'
[download] Destination: Natalie's Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.f137.mp4
[download] 100% of 21.32MiB in 00:15
[debug] Invoking downloader on u'https://r3---sn-v2u0n-hxaz.googlevideo.com/videoplayback?ipbits=0&pl=16&clen=2576978&requiressl=yes&mime=audio%2Fwebm&expire=1520946797&pcm2cms=yes&c=WEB&initcwndbps=913750&mm=31%2C29&signature=50207F7FBFBC34AA473C626BAA33CD228254FC9B.37DD93B336E3A1EC0AE0E1CB607B88C856CCBBDB&mn=sn-v2u0n-hxaz%2Csn-ntq7yn7s&key=yt6&ip=49.177.75.23&dur=158.261&keepalive=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cexpire&source=youtube&lmt=1518112890956884&ei=DXqnWvmlGs2W4AKO877IDA&id=o-ADN0zPteh9880L9AyqGW5DU3E7rwB4VY9Apnk0vJYj-z&ms=au%2Crdu&mt=1520925109&mv=m&fvip=1&itag=251&gir=yes&ratebypass=yes'
[download] Destination: Natalie's Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.f251.webm
[download] 100% of 2.46MiB in 00:02
[ffmpeg] Merging formats into "Natalie's Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.mkv"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Natalie'"'"'s Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.f137.mp4' -i 'file:Natalie'"'"'s Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.f251.webm' -c copy -map '0:v:0' -map '1:a:0' 'file:Natalie'"'"'s Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.temp.mkv'
Deleting original file Natalie's Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.f137.mp4 (pass -k to keep)
Deleting original file Natalie's Rap 2.0 (Uncensored Version)-B8K9jAJ3Ong.f251.webm (pass -k to keep)
@elit3ge
Copy link

@elit3ge elit3ge commented Mar 13, 2018

I have the same issues on Windows

c:\youtube-dl>youtube-dl.exe --verbose https://www.9now.com.au/travel-guides/season-2/episode-4
[debug] System config: []
[debug] User config: ['--ffmpeg-location', 'C:\\ffmpeg\\bin']
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.9now.com.au/travel-guides/season-2/episode-4']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2018.03.10
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.16299
[debug] exe versions: ffmpeg 3.4.2, ffprobe 3.4.2
[debug] Proxy map: {}
[9now.com.au] episode-4: Downloading webpage
[brightcove:new] 5739867961001: Downloading webpage
ERROR: Unable to extract policy key; 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 "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpzznjsz2q\build\youtube_dl\YoutubeDL.py", line 785, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpzznjsz2q\build\youtube_dl\extractor\common.py", line 440, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpzznjsz2q\build\youtube_dl\extractor\brightcove.py", line 693, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpzznjsz2q\build\youtube_dl\extractor\common.py", line 796, in _search_regex
youtube_dl.utils.RegexNotFoundError: Unable to extract policy key; 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.
@section83
Copy link

@section83 section83 commented Mar 13, 2018

'Tis odd. Here is what I've just run:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--restrict-filenames', u'--no-overwrites', u'--verbose', u'-o', u'travel_guides-%(title)s.%(ext)s', u'https://www.9now.com.au/travel-guides/season-2/episode-4']
[debug] Encodings: locale US-ASCII, fs utf-8, out None, pref US-ASCII
[debug] youtube-dl version 2018.03.10
[debug] Python version 2.7.10 (CPython) - Darwin-16.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.4.2-tessus, ffprobe 3.4.2-tessus, rtmpdump 2.4
[debug] Proxy map: {}
[9now.com.au] episode-4: Downloading webpage
[brightcove:new] 5739867961001: Downloading webpage
[brightcove:new] 5739867961001: Downloading JSON metadata
[brightcove:new] 5739867961001: Downloading m3u8 information
[brightcove:new] 5739867961001: Downloading m3u8 information
[brightcove:new] 5739867961001: Downloading m3u8 information
[brightcove:new] 5739867961001: Downloading m3u8 information
[brightcove:new] 5739867961001: Downloading m3u8 information
[brightcove:new] 5739867961001: Downloading m3u8 information
[brightcove:new] 5739867961001: Downloading MPD manifest
[brightcove:new] 5739867961001: Downloading MPD manifest
[brightcove:new] 5739867961001: Downloading MPD manifest
[brightcove:new] 5739867961001: Downloading MPD manifest
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://manifest.prod.boltdns.net/manifest/v1/hls/v5/clear/4460760524001/ef288b63-1ce4-4ade-9836-d84d4813bf7b/8236c5a9-15ca-4b06-9496-14674ba43e74/10s/rendition.m3u8?fastly_token=NWFhODU0ZjJfOTM5ZTk5MjVlOTM1ZmQ0NmE2ZDQ3MWVhMWU0YmZiYmI0MjQxYWI2NzkxY2QwZjlmNjc1NjU3M2IzZGFlNmRmOA%3D%3D'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 291
[download] Destination: travel_guides-South_Africa.fhls-2407-3.mp4

[download]   0.0% of ~1023.54MiB at 27.05KiB/s ETA 83:21:01
[download]   0.0% of ~1023.54MiB at 80.43KiB/s ETA 27:48:42
etc. etc.

So, I don't know what's going on. I can only scratch for ideas. Are you inside Australia ? Most FTA broadcasters have geo-blocks in place (although youtube-dl can get around them). Are you going through a VPN ? Hopefully one of the ytdl experts can help.

@elit3ge
Copy link

@elit3ge elit3ge commented Mar 13, 2018

Yes, I am inside Australia. Just tried on MacOS and the same issue.

@section83
Copy link

@section83 section83 commented Mar 14, 2018

Heck. I'm trying to imagine what could be preventing you from access 9Now but not me. Do you have any modem settings that could be involved ? e.g. port forwarding or anything like that ? It looks like the error happens when youtube-dl tries to DL the web page or the JSON data. Can you track the ip address from which youtube-dl is trying to DL ? On a Mac, the "LittleSnitch" utility can help with that. Perhaps if we can find out what the "policy key" is, it will be solvable.

There's an interesting bit in the error "Unable to extract %s' % _name". Is that the show name ? Try replicating the command line that worked for me which has an output template. i.e.:

youtube-dl --restrict-filenames --no-overwrites --verbose -o 'travel_guides-%(title)s.%(ext)s' "https://www.9now.com.au/travel-guides/season-2/episode-4"

Another idea: add the "--print-traffic" option. That might show a problem with youtube-dl trying to access something.

@elit3ge
Copy link

@elit3ge elit3ge commented Mar 14, 2018

Found my issue. PiHole has been blocking players.brightcove.net whitelisted the domain, back in action! Thanks for your assistance.

@Pseudomocha
Copy link
Author

@Pseudomocha Pseudomocha commented Mar 17, 2018

Yep my issue is solved too. Didn't even consider that could be the problem. Thanks for your help, @section83

@section83
Copy link

@section83 section83 commented Mar 17, 2018

Good to know problem's solved. If you're using a Mac, have a look at MacYTDL. I'm currently working on v1.4 and need some feedback on what it does/does not.

Cheers.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.