Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
videomega.tv is broken #7606
videomega.tv is broken #7606
Comments
|
Videomega encrypts link to real video file. I don't know how it can be bypassed in python, but in JS you need first extract eval function from videomega iframe page and then run it to get real link.
|
|
I decoded the mp4 found in the eval function and the video still will not download. eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('$("5").6("4","3://0.1.2.7/8/d.e?c=b&9=a-f");',16,16,'ab1|cdn|vizplay|http|src|video|attr|org|v|hash|0eOZNdBc9Q|OqWQxdqzJoKTxFx8E7Y0PQ|st|fb2ffbadf624a7cca80efd808f7747c2|mp4|476ZsZ5u7Tw'.split('|'),0,{})) |
|
Can you post here original link from where you're trying to get download link? |
|
Here you go. |
|
Perfectly downloaded by my script. I'm currently develop an addon for Mozilla Firefox so the syntax is a little different than the clear JS. You need to do this steps to get a link: // 1) load original page html
var content = ... ;
// 2) extract valid link
var videomegaUrlRegex = /(https?:\/\/(www\.)?videomega\.tv\/(view|iframe|cdn)\.php\?ref=([A-Za-z0-9]+))/;
var iframeUrl = videomegaUrlRegex.exec(content)[1];
// 3) send GET request to this link with next header (the site isn't important):
headers: { "Referer": "http://google.com/"},
// 4) get response html and extract eval expression
var iframeHtml = ...;
var regex = /(eval[^<]+)/;
var str = regex.exec(iframeHtml )[1];
str = str.replace(/\$\("\d"\).\d/, ""); // replace jquery reference
// 5) evaluate this string to get a download link
var downloadLink = eval(str);
// 5) do something with this link |
|
Interesting, my download link works in Firefox and not in Chrome. Before I was using chrome to download the url. With that said, the URL is bound to the IP so I converted the code to php and attempted to fetch and pipe the download from my dev server with no luck. Hopefully someone can fix youtube-dl. |
|
Chrome opens link as a media and you need to press Ctrl + S to download file. |
|
Great tip! Is anyone working on fixing youtube-dl, it still only downloads a 100kbs file. |
|
when i try to get the info , it gives me the black video that sounds like people in the backround and not the url link , i can get the url of the video in c# if i sniff http and grab it there but i am trying to do it all in python with youtube-dl. instead of grabbing the real link from c# and then download via python. this is what i am getting back http://abo.cdn.vizplay.org/v/1/aaaa1e04c23889aaec7251ca54fc1a8a.mp4?st=16EAWN6461t1mpoVWHru_w&hash=aYpJoz7HKPj_QA8n4QSfNg black video instead of real video. here is the real video link i can grab using my c# code but id rather do it all in python. -snipped url- what i do in c# i use the fiddler core api to sniff traffic to grab the url of the video the downside is that since i am not so good at c# i still have to manually go to the page of the video i want to download :( |
|
I think it's not possible to do with youtube-dl unless developers didn't add dependency for PyExecJS or another library to evaluate JS expression. And I don't know how it can be useful if only this site requires it. |
|
Other tube sites that uses JS eval. |
|
ok so this is really ugly but i took what alex said and put it into python and came up with
it works perfectly , thank you alex for making me teach myself , this code is quick and dirty so all by means feel free to clean it up. this website came in handy https://regex101.com/ |
|
Can someone add this to youtube-dl with a pull request? |
|
Videomega, at least http://videomega.tv/?ref=83yVRkJym44myJkRVy38, uses the same obfuscation technique as iQiyi. It can be handled with pure Python. It's not a good idea to use external libraries, especially dangerous |
|
This site will work again in the next version. Thanks everyone that provides ideas. |
|
i have the same problem on streaming film |
|
@wahiba2 Please open a new issue and paste a concrete video URL instead of the homepage of a website. |
For videomega.tv a 100Kb file is downloaded and not the actual video.
/usr/local/bin/youtube-dl -o /root/tmp/debug.mp4 http://videomega.tv/?ref=83yVRkJym44myJkRVy38
[VideoMega] 83yVRkJym44myJkRVy38: Downloading webpage
[download] Destination: /root/tmp/debug.mp4
[download] 100% of 103.59KiB in 00:00