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

VIKI cannot download the video, as if the signature has changed #14181

Closed
hucaloof opened this issue Sep 12, 2017 · 11 comments
Closed

VIKI cannot download the video, as if the signature has changed #14181

hucaloof opened this issue Sep 12, 2017 · 11 comments

Comments

@hucaloof
Copy link

@hucaloof hucaloof commented Sep 12, 2017

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.09.11. 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 2017.09.11

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

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 ```):

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--restrict-filenames', u'-o', u'/data/viki/zuijiaqiannanyou/%(title)s.%(ext)s', u'--proxy', u'http://138.68.16.252:3128', u'https://www.viki.com/tv/28818c-my-best-ex-boyfriend#modal-episode']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.09.11
[debug] Git HEAD: fd0b8fc
[debug] Python version 2.7.13 - Linux-2.6.32-431.el6.x86_64-x86_64-with-centos-6.5-Final
[debug] exe versions: ffmpeg 3.3.3, ffprobe 3.3.3, rtmpdump 2.3
[debug] Proxy map: {u'http': u'http://138.68.16.252:3128', u'https': u'http://138.68.16.252:3128'}
[viki:channel] 28818c: Downloading channel JSON
[viki:channel] 28818c: Downloading episodes JSON page #1
[viki:channel] 28818c: Downloading episodes JSON page #2
[viki:channel] 28818c: Downloading clips JSON page #1
[viki:channel] 28818c: Downloading movies JSON page #1
[download] Downloading playlist: My Best Ex-Boyfriend
[viki:channel] playlist My Best Ex-Boyfriend: Collected 55 video ids (downloading 55 of them)
[download] Downloading video 1 of 55
[viki] 1077337v: Downloading video JSON
[viki] 1077337v: Downloading video streams JSON
ERROR: viki returned error: invalid signature
Traceback (most recent call last):
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 776, in extract_info
    ie_result = ie.extract(url)
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 434, in extract
    ie_result = self._real_extract(url)
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/viki.py", line 270, in _real_extract
    'Downloading video streams JSON')
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/viki.py", line 69, in _call_api
    self._raise_error(resp['error'])
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/viki.py", line 76, in _raise_error
    expected=True)
ExtractorError: viki returned error: invalid signature

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):


Description of your issue, suggested solution and other information

I think VIKI changed the signature algorithm, but what exactly is I do not kno

@icebadger
Copy link

@icebadger icebadger commented Sep 12, 2017

I can replicate your issue with the link provided. I get the same debug output.

For other videos, I get a geolocation error, even though I can play fine from browser.

Playlist: https://www.viki.com/tv/28448c-she-was-pretty#modal-episode

[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.viki.com/tv/28448c-she-was-pretty#modal-episode']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.09.11
[debug] Python version 2.7.13 - Linux-4.10.0-33-generic-x86_64-with-Ubuntu-17.04-zesty
[debug] exe versions: avconv 3.2.4-1build2, avprobe 3.2.4-1build2, ffmpeg 3.2.4-1build2, ffprobe 3.2.4-1build2, rtmpdump 2.4
[debug] Proxy map: {}
[viki:channel] 28448c: Downloading channel JSON
ERROR: Sorry, this content is not available in your region.
You might want to use a VPN or a proxy server (with --proxy) to workaround.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 776, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 434, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/viki.py", line 364, in _real_extract
    self._check_errors(channel)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/viki.py", line 83, in _check_errors
    self.raise_geo_restricted(msg=message)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 732, in raise_geo_restricted
    raise GeoRestrictedError(msg, countries=countries)
GeoRestrictedError: Sorry, this content is not available in your region.

I am wondering if these have the same root cause.

@hucaloof
Copy link
Author

@hucaloof hucaloof commented Sep 12, 2017

VIKI site has regional restrictions, some areas of the IP address can access the page, but can not play video

@icebadger
Copy link

@icebadger icebadger commented Sep 12, 2017

I understand this. In this instance, I am able to play the video (in browser) from my local IP and VPN connections. However starting today, I get either the geolocation or signature error depending on the playlist attempted.

If you try the playlist I posted above, error code does it fail on?

@hucaloof
Copy link
Author

@hucaloof hucaloof commented Sep 12, 2017

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--restrict-filenames', u'--proxy', u'http://138.68.16.252:3128', u'https://www.viki.com/tv/28448c-she-was-pretty#modal-episode']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.09.11
[debug] Git HEAD: fd0b8fc
[debug] Python version 2.7.13 - Linux-2.6.32-431.el6.x86_64-x86_64-with-centos-6.5-Final
[debug] exe versions: ffmpeg 3.3.3, ffprobe 3.3.3, rtmpdump 2.3
[debug] Proxy map: {u'http': u'http://138.68.16.252:3128', u'https': u'http://138.68.16.252:3128'}
[viki:channel] 28448c: Downloading channel JSON
ERROR: Sorry, this content is not available in your region.
You might want to use a VPN or a proxy server (with --proxy) to workaround.
Traceback (most recent call last):
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 776, in extract_info
    ie_result = ie.extract(url)
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 434, in extract
    ie_result = self._real_extract(url)
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/viki.py", line 364, in _real_extract
    self._check_errors(channel)
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/viki.py", line 83, in _check_errors
    self.raise_geo_restricted(msg=message)
  File "/root/.pyenv/versions/2.7.13/envs/env27/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 732, in raise_geo_restricted
    raise GeoRestrictedError(msg, countries=countries)
GeoRestrictedError: Sorry, this content is not available in your region.

The playlist above requires the use of VPN, and I don't have any other VPN addresses to try

@icebadger
Copy link

@icebadger icebadger commented Sep 12, 2017

My Hong Kong and South Korea VPN says its restricted, but my US and UK VPNs allow me to play, and it plays in Germany. I have a feeling it is also a signature issue, but it is throwing the geolocation error for videos that are restricted in some regions.

@hucaloof
Copy link
Author

@hucaloof hucaloof commented Sep 12, 2017

Is there any way to solve this problem? I can't download all the videos in VIKI now.

@icebadger
Copy link

@icebadger icebadger commented Sep 12, 2017

I'm not sure right now.

@sebaro
Copy link

@sebaro sebaro commented Sep 14, 2017

app=100005a
secret=MM_d*yP@`&1@]@!AVrXf_o-HVEnoTnm$O-ti4[G~$JDI/Dc-&piU&z&5.;:}95\=Iad

@icebadger
Copy link

@icebadger icebadger commented Sep 14, 2017

Just tried this in the viki.py file, and it generates an HTTP Error 400: Bad Request

_APP = '100005a'
_APP_VERSION = '2.2.5.1428709186'
_APP_SECRET = 'MM_d*yP@`&1@]@!AVrXf_o-HVEnoTnm$O-ti4[G~$JDI/Dc-&piU&z&5.;:}95\=Iad'

Is there an update to the _APP_VERSION as well?

@sebaro
Copy link

@sebaro sebaro commented Sep 14, 2017

_APP_VERSION is not used in the code so it's not the problem.

The problem is the backslash from key string. To work in python remove it:

import hashlib
import hmac
import urllib2
import time

v = "1102617v"
a = "100005a"
k = "MM_d*yP@`&1@]@!AVrXf_o-HVEnoTnm$O-ti4[G~$JDI/Dc-&piU&z&5.;:}95=Iad"
t = str(int(time.time()))
q = "/v5/videos/" + v + "/streams.json?app=" + a + "&t=" + t + "&site=www.viki.com"
s = hmac.new(k.encode('ascii', 'backslashreplace'), q.encode('ascii'), hashlib.sha1).hexdigest()
u = "https://api.viki.io" + q + "&sig=" + s
r = urllib2.Request(u)
r.add_header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0")
o = urllib2.urlopen(r)
print o.read()
@hucaloof
Copy link
Author

@hucaloof hucaloof commented Sep 15, 2017

The Chrome developers see capture version should be updated to 3.2, but I have not tested

@dstftw dstftw closed this in 8251af6 Sep 16, 2017
@ytdl-org ytdl-org deleted a comment from icebadger May 25, 2019
@ytdl-org ytdl-org locked as resolved and limited conversation to collaborators May 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
@icebadger @hucaloof @sebaro and others
You can’t perform that action at this time.