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

Vidzi is broken #6819

Closed
davek-cygwin opened this issue Sep 10, 2015 · 5 comments
Closed

Vidzi is broken #6819

davek-cygwin opened this issue Sep 10, 2015 · 5 comments

Comments

@davek-cygwin
Copy link

@davek-cygwin davek-cygwin commented Sep 10, 2015

C:\Projects\rg3\youtube-dl>python -m youtube_dl "http://vidzi.tv/jnk3om3hftz4.html" --verbose 2>&1 | tee fail-vidzi.log

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'http://vidzi.tv/jnk3om3hftz4.html', u'--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out None, pref cp1252
[debug] youtube-dl version 2015.09.09
[debug] Git HEAD: 1721fef
[debug] Python version 2.7.8 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg 0.8.1, rtmpdump 2.4
[debug] Proxy map: {}
[Vidzi] jnk3om3hftz4: Downloading webpage
ERROR: Unable to extract video url; 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 "youtube_dl\YoutubeDL.py", line 660, in extract_info
ie_result = ie.extract(url)
File "youtube_dl\extractor\common.py", line 287, in extract
return self.real_extract(url)
File "youtube_dl\extractor\vidzi.py", line 24, in real_extract
r'{\s_file\s
:\s
"([^"]+)"\s_}', webpage, 'video url')
File "youtube_dl\extractor\common.py", line 584, in _html_search_regex
res = self._search_regex(pattern, string, name, default, fatal, flags, group)
File "youtube_dl\extractor\common.py", line 575, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract video url; 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.

@davek-cygwin
Copy link
Author

@davek-cygwin davek-cygwin commented Sep 10, 2015

Body of webpage: https://gist.github.com/davek-cygwin/9ba2d360d963dbc0495f

Relevant part is:

<script type="text/javascript" src="http://static.vidzi.tv/nplayer/jwplayer.js"></script>
                      <script type='text/javascript'>eval(function(p,a,c,k,e,d){while(c--)if(k[c])p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c]);return p}('4("2t").2s({2r:[{2q:"2://w.u.t.s:r/i/2p/q/9.2o",2n:"2://2m.6.8/2l/6.2k",2j:[{a:"2://6.8/9-o.2i?2h=",2g:\'2f\'},{a:"2://w.u.t.s:r/2e/v.2d"}],2c:[{a:"2://6.8/p/q/2b.p",2a:"29",n:"28"},{a:"2://6.8/9-o.27",n:"26"}]}],25:24,23:"22",21:3,1z:1y,1x:1,1w:1v,1u:1t,1s:{1r:l,1q:\'1p\',1o:\'1n\',1m:20},1l:1k});h b;h g=0;h 7=0;4().1j(5(x){c(7>0)g+=x.m-7;7=x.m;c(0!=0&&g>=0){7=-1;4().1i();4().1h(l);$(\'#1g\').f();$(\'e.d\').f()}});4().1f(5(x){7=-1});4().1e(5(x){k(x)});4().1d(5(){$(\'e.d\').f()});5 k(x){$(\'e.d\').1c();c(b)1b;b=1;$.1a(\'2://6.8/j-19/18.j?17=16&15=9&14=13-12-11-10-z\',5(y){})}',36,102,'||http||jwplayer|function|vidzi|p0242296|tv|jnk3om3hftz4|file|vvplay|if|video_ad|div|show|tt242296|var||cgi|doPlay|false|position|kind|c4d4eb72532019084b9e8b42c1d68f0a|srt|00048|8777|155|98|81||77||data|7ce405bc990115957951f5a3aad0f2e7|1441844182|210|85|242296|hash|file_code|ajax|op|index_dl|bin|get|return|hide|onComplete|onPlay|onSeek|play_limit_box|setFullscreen|stop|onTime|640|width|fontsize|Verdana|fontFamily|FFFFFF|color|back|captions|900|hls_maxbackbufferlength|300|hls_maxbufferlength|hls_startfromlevel|true|androidhls||hls_minbufferlength|flash|primary|360|height|thumbnails|vtt|subtitles|Croatian|label|jnk3om3hftz4_Croatian|tracks|mp4|bfuqidr73y2qedz7nktr5ejkl4pzadqtgjicmgo6lvaoqjl3evsehut3zdva|hls|type|embed|m3u8|sources|swf|nplayer|static|provider|jpg|01|image|playlist|setup|vplayer'.split('|')))
</script>

This decodes to:

jwplayer("vplayer").setup({playlist:[{image:"http://77.81.98.155:8777/i/01/00048/jnk3om3hftz4.jpg",provider:"http://static.vidzi.tv/nplayer/vidzi.swf",sources:[{file:"http://vidzi.tv/jnk3om3hftz4-c4d4eb72532019084b9e8b42c1d68f0a.m3u8?embed=",type:'hls'},{file:"http://77.81.98.155:8777/bfuqidr73y2qedz7nktr5ejkl4pzadqtgjicmgo6lvaoqjl3evsehut3zdva/v.mp4"}],tracks:[{file:"http://vidzi.tv/srt/00048/jnk3om3hftz4_Croatian.srt",label:"Croatian",kind:"subtitles"},{file:"http://vidzi.tv/jnk3om3hftz4-c4d4eb72532019084b9e8b42c1d68f0a.vtt",kind:"thumbnails"}]}],height:360,primary:"flash",hls_minbufferlength:3,androidhls:true,hls_startfromlevel:1,hls_maxbufferlength:300,hls_maxbackbufferlength:900,captions:{back:false,color:'FFFFFF',fontFamily:'Verdana',fontsize:20},width:640});var vvplay;var tt242296=0;var p0242296=0;jwplayer().onTime(function(x){if(p0242296>0)tt242296+=x.position-p0242296;p0242296=x.position;if(0!=0&&tt242296>=0){p0242296=-1;jwplayer().stop();jwplayer().setFullscreen(false);$('#play_limit_box').show();$('div.video_ad').show()}});jwplayer().onSeek(function(x){p0242296=-1});jwplayer().onPlay(function(x){doPlay(x)});jwplayer().onComplete(function(){$('div.video_ad').show()});function doPlay(x){$('div.video_ad').hide();if(vvplay)return;vvplay=1;$.get('http://vidzi.tv/cgi-bin/index_dl.cgi?op=ajax&file_code=jnk3om3hftz4&hash=242296-85-210-1441844182-7ce405bc990115957951f5a3aad0f2e7',function(data){})}

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Sep 10, 2015

this can be fixed temporaly by adding this code to vidzi.py:

        def unpack_packer(p, a, c, k, s):
            k = k.split(s)
            import gmpy2
            for i in range(int(c) - 1, 1, -1):
                p = re.sub('\\b' + gmpy2.digits(i, int(a)) + '\\b', k[i], p)
            return p

        def unpack(content):
            packers = re.findall(r'function\(p,a,c,k,e,d\){.+}\(\'.*\',\d+,\d+,\'[^\']+\'\.split\(\'.\'\)', content)
            for (packer) in packers:
                p, a, c, k, s = re.search(r'function\(p,a,c,k,e,d\){.+}\(\'(.*)\',(\d+),(\d+),\'([^\']+)\'\.split\(\'(.)\'\)', packer).groups()
                content = content.replace(packer, unpack_packer(p, a, c, k, s))
            return content
        webpage = unpack(webpage)

after this line:

        webpage = self._download_webpage(url, video_id)

it requires to install gmpy2.
for linux it can be installed using this command:

pip install gmpy2
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 10, 2015

@remitamine Thanks for proposing a solution. I guess gmpy2.digits(x, base) can be implemented in pure Python codes. Using pure Python reduces the effort to make the extractor work on Windows, which is used by @davek-cygwin

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Sep 10, 2015

I guess gmpy2.digits(x, base) can be implemented in pure Python codes.

there are a lot of solution but i don't know what code will be accepted to add to youtube-dl because i didn't find a code with the same licence(as i know you accept only code from projects licenced under the public domain)

for windows, gmpy2 can be downloaded from here:
https://code.google.com/p/gmpy/downloads/list

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 26, 2016

Thanks for the report and all that provide ideas. Vidzi will work again in the next version.

@yan12125 yan12125 closed this Feb 26, 2016
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.