Open Blatzar opened 4 years ago
Wow you still get different errors.. You don't seem to have the path one at all.
@LiteracyFanatic any ideas how to solve this?
Here's what I've got so far. Adding from os import path
resolves the error you found. I'm not really sure why that's necessary; I'll have to do some reading. However, this still doesn't work properly because the value from the js is being returned incorrectly. Here's the raw js run through a formatter.
eval = console.log;
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;
})(
'n.1q={1p:"",q:"c",1o:"3://r.2.1/i/1n/6.1m",1l:[{b:"3://r.2.1:1k/d/1j/c.p",q:"c/p",}],};9 o=m.1i("1h");o.1g=l(){n.1f();k.1e("3://8.2.1/6");1d 1c};$(m).1b(l(){1a($(k).a()<19){$("#5").4("b","3://j.2.1/18.7");$("#5").4("h","g");$("#5").4("a","17")}16{$("#5").4("b","3://j.2.1/15.7");$("#5").4("h","g");$("#5").4("a","14")}});9 13="3://8.2.1/6";9 f=\'<e 12="3://8.2.1/f-6.7" 11=0 10=0 z=0 y=x w=v u=t s></e>\';',
36,
63,
"|com|mp4upload|https|attr|aa1fa793|x50ng81bqkhy|html|www|var|width|src|video||IFRAME|embed|260|height||cdn|window|function|document|player|dl|mp4|type|www6|allowfullscreen|360|HEIGHT|494|WIDTH|NO|SCROLLING|MARGINHEIGHT|MARGINWIDTH|FRAMEBORDER|SRC|link|620|2bb|else|310|1bb|670|if|ready|false|return|open|pause|onclick|download|getElementById|sgx36fq3z3b4quuo3owaezyqj5pyyuhzwv76gqblwefm4ky4kzzdvpy4|282|sources|jpg|01239|poster|title|source".split(
"|"
)
)
);
Which can be rewritten like this:
let p = 'n.1q={1p:"",q:"c",1o:"3://r.2.1/i/1n/6.1m",1l:[{b:"3://r.2.1:1k/d/1j/c.p",q:"c/p",}],};9 o=m.1i("1h");o.1g=l(){n.1f();k.1e("3://8.2.1/6");1d 1c};$(m).1b(l(){1a($(k).a()<19){$("#5").4("b","3://j.2.1/18.7");$("#5").4("h","g");$("#5").4("a","17")}16{$("#5").4("b","3://j.2.1/15.7");$("#5").4("h","g");$("#5").4("a","14")}});9 13="3://8.2.1/6";9 f=\'<e 12="3://8.2.1/f-6.7" 11=0 10=0 z=0 y=x w=v u=t s></e>\';';
let a = 36;
let c = 63;
let k = "|com|mp4upload|https|attr|aa1fa793|x50ng81bqkhy|html|www|var|width|src|video||IFRAME|embed|260|height||cdn|window|function|document|player|dl|mp4|type|www6|allowfullscreen|360|HEIGHT|494|WIDTH|NO|SCROLLING|MARGINHEIGHT|MARGINWIDTH|FRAMEBORDER|SRC|link|620|2bb|else|310|1bb|670|if|ready|false|return|open|pause|onclick|download|getElementById|sgx36fq3z3b4quuo3owaezyqj5pyyuhzwv76gqblwefm4ky4kzzdvpy4|282|sources|jpg|01239|poster|title|source".split("|");
while (c--) {
if (k[c]) {
p = p.replace(new RegExp("\\b" + c.toString(a) + "\\b", "g"), k[c]);
}
}
console.log(p);
And evaluates to this:
player.source = {
title: "",
type: "video",
poster: "https://www6.mp4upload.com/i/01239/x50ng81bqkhy.jpg",
sources: [
{
src:
"https://www6.mp4upload.com:282/d/sgx36fq3z3b4quuo3owaezyqj5pyyuhzwv76gqblwefm4ky4kzzdvpy4/video.mp4",
type: "video/mp4",
},
],
};
var dl = document.getElementById("download");
dl.onclick = function () {
player.pause();
window.open("https://www.mp4upload.com/x50ng81bqkhy");
return false;
};
$(document).ready(function () {
if ($(window).width() < 670) {
$("#aa1fa793").attr("src", "https://cdn.mp4upload.com/1bb.html");
$("#aa1fa793").attr("height", "260");
$("#aa1fa793").attr("width", "310");
} else {
$("#aa1fa793").attr("src", "https://cdn.mp4upload.com/2bb.html");
$("#aa1fa793").attr("height", "260");
$("#aa1fa793").attr("width", "620");
}
});
var link = "https://www.mp4upload.com/x50ng81bqkhy";
var embed =
'<IFRAME SRC="https://www.mp4upload.com/embed-x50ng81bqkhy.html" FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=494 HEIGHT=360 allowfullscreen></IFRAME>';
I believe there is an issue related to the use of console.log
and eval
that is keeping the actual value we want from being returned properly. I'll need to do a bit more digging to figure out for sure what's going on.
I've added a preliminary fix. There's more work to be done to make sure all the other sites work as well, but this should be usable as is if you need it now.
Describe the bug
https://github.com/vn-ki/anime-downloader/commit/9e254ccd2b85eb72cd40ecef36a4b937c13e3dfb seems to have caused issues with eval_in_node()
Without modifications it gives
NameError: name 'path' is not defined
Editing https://github.com/vn-ki/anime-downloader/blob/master/anime_downloader/util.py#L402 to os.path will result in error below
To reproduce
LOG
``` bl@arch ~> anime -ll DEBUG dl "hunter x hunter" --provider animekisa -c 2 2020-08-22 14:01:28 arch anime_downloader.util[84260] INFO anime-downloader 4.6.3 2020-08-22 14:01:28 arch anime_downloader.util[84260] DEBUG Platform: Linux-5.7.7-arch1-1-x86_64-with-glibc2.2.5 2020-08-22 14:01:28 arch anime_downloader.util[84260] DEBUG Python 3.8.3 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG GET https://animekisa.tv/search 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {'params': {'q': 'hunter x hunter'}} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5'} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.session[84260] DEBUG cached request 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG https://animekisa.tv/search?q=hunter+x+hunter 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG /tmp/animedlm6tlqktt/tmpzys605nr +--------+--------------------------------------------------+--------+ | 12 | Hunter x Hunter Movie 2: The Last Mission | | | 11 | Hunter x Hunter Movie 2: The Last Mission Dubbed | | | 10 | Hunter x Hunter: Phantom Rouge | | | 9 | Hunter x Hunter: The Last Mission | | | 8 | Hunter x Hunter: Phantom Rouge Dubbed | | | 7 | Hunter x Hunter Dubbed | | | 6 | Hunter x Hunter (2011) Dubbed | | | 5 | Hunter X Hunter OVA 2 | | | 4 | Hunter X Hunter OVA | | | 3 | Hunter X Hunter OVA 3 | | | 2 | Hunter X Hunter | | | 1 | Hunter x Hunter (2011) | | |--------+--------------------------------------------------+--------| | SlNo | Title | Meta | +--------+--------------------------------------------------+--------+ 2020-08-22 14:01:28 arch anime_downloader.util[84260] INFO Selected Hunter X Hunter 2020-08-22 14:01:28 arch anime_downloader.sites.anime[84260] INFO Extracting episode info from page 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG GET https://www.animekisa.tv/hunter-x-hunter 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5'} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.session[84260] DEBUG cached request 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG https://animekisa.tv/hunter-x-hunter 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG /tmp/animedlm6tlqktt/tmpainpf2o4 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG GET https://www.animekisa.tv/hunter-x-hunter 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5'} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.session[84260] DEBUG cached request 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG https://animekisa.tv/hunter-x-hunter 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG /tmp/animedlm6tlqktt/tmpls19pkb8 2020-08-22 14:01:28 arch anime_downloader.sites.anime[84260] DEBUG EPISODE IDS: length: 62, ids: ['https://animekisa.tv/hunter-x-hunter-episode-1', 'https://animekisa.tv/hunter-x-hunter-episode-2', 'https://animekisa.tv/hunter-x-hunter-episode-3', 'https://animekisa.tv/hunter-x-hunter-episode-4', 'https://animekisa.tv/hunter-x-hunter-episode-5', 'https://animekisa.tv/hunter-x-hunter-episode-6', 'https://animekisa.tv/hunter-x-hunter-episode-7', 'https://animekisa.tv/hunter-x-hunter-episode-8', 'https://animekisa.tv/hunter-x-hunter-episode-9', 'https://animekisa.tv/hunter-x-hunter-episode-10', 'https://animekisa.tv/hunter-x-hunter-episode-11', 'https://animekisa.tv/hunter-x-hunter-episode-12', 'https://animekisa.tv/hunter-x-hunter-episode-13', 'https://animekisa.tv/hunter-x-hunter-episode-14', 'https://animekisa.tv/hunter-x-hunter-episode-15', 'https://animekisa.tv/hunter-x-hunter-episode-16', 'https://animekisa.tv/hunter-x-hunter-episode-17', 'https://animekisa.tv/hunter-x-hunter-episode-18', 'https://animekisa.tv/hunter-x-hunter-episode-19', 'https://animekisa.tv/hunter-x-hunter-episode-20', 'https://animekisa.tv/hunter-x-hunter-episode-21', 'https://animekisa.tv/hunter-x-hunter-episode-22', 'https://animekisa.tv/hunter-x-hunter-episode-23', 'https://animekisa.tv/hunter-x-hunter-episode-24', 'https://animekisa.tv/hunter-x-hunter-episode-25', 'https://animekisa.tv/hunter-x-hunter-episode-26', 'https://animekisa.tv/hunter-x-hunter-episode-27', 'https://animekisa.tv/hunter-x-hunter-episode-28', 'https://animekisa.tv/hunter-x-hunter-episode-29', 'https://animekisa.tv/hunter-x-hunter-episode-30', 'https://animekisa.tv/hunter-x-hunter-episode-31', 'https://animekisa.tv/hunter-x-hunter-episode-32', 'https://animekisa.tv/hunter-x-hunter-episode-33', 'https://animekisa.tv/hunter-x-hunter-episode-34', 'https://animekisa.tv/hunter-x-hunter-episode-35', 'https://animekisa.tv/hunter-x-hunter-episode-36', 'https://animekisa.tv/hunter-x-hunter-episode-37', 'https://animekisa.tv/hunter-x-hunter-episode-38', 'https://animekisa.tv/hunter-x-hunter-episode-39', 'https://animekisa.tv/hunter-x-hunter-episode-40', 'https://animekisa.tv/hunter-x-hunter-episode-41', 'https://animekisa.tv/hunter-x-hunter-episode-42', 'https://animekisa.tv/hunter-x-hunter-episode-43', 'https://animekisa.tv/hunter-x-hunter-episode-44', 'https://animekisa.tv/hunter-x-hunter-episode-45', 'https://animekisa.tv/hunter-x-hunter-episode-46', 'https://animekisa.tv/hunter-x-hunter-episode-47', 'https://animekisa.tv/hunter-x-hunter-episode-48', 'https://animekisa.tv/hunter-x-hunter-episode-49', 'https://animekisa.tv/hunter-x-hunter-episode-50', 'https://animekisa.tv/hunter-x-hunter-episode-51', 'https://animekisa.tv/hunter-x-hunter-episode-52', 'https://animekisa.tv/hunter-x-hunter-episode-53', 'https://animekisa.tv/hunter-x-hunter-episode-54', 'https://animekisa.tv/hunter-x-hunter-episode-55', 'https://animekisa.tv/hunter-x-hunter-episode-56', 'https://animekisa.tv/hunter-x-hunter-episode-57', 'https://animekisa.tv/hunter-x-hunter-episode-58', 'https://animekisa.tv/hunter-x-hunter-episode-59', 'https://animekisa.tv/hunter-x-hunter-episode-60', 'https://animekisa.tv/hunter-x-hunter-episode-61', 'https://animekisa.tv/hunter-x-hunter-episode-62'] 2020-08-22 14:01:28 arch anime_downloader.commands.dl[84260] INFO Found anime: Hunter X Hunter 2020-08-22 14:01:28 arch anime_downloader.commands.dl[84260] INFO Downloading to /home/bl 2020-08-22 14:01:28 arch anime_downloader.sites.anime[84260] DEBUG Extracting stream info of id: https://animekisa.tv/hunter-x-hunter-episode-1 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG GET https://animekisa.tv/hunter-x-hunter-episode-1 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5'} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.session[84260] DEBUG cached request 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG https://animekisa.tv/hunter-x-hunter-episode-1 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG /tmp/animedlm6tlqktt/tmp8na8u6fg 2020-08-22 14:01:28 arch anime_downloader.sites.animekisa[84260] DEBUG Preferred server gcloud not found. Trying all supported servers 2020-08-22 14:01:28 arch anime_downloader.sites.anime[84260] DEBUG Sources : [('mp4upload', 'https://www.mp4upload.com/embed-x50ng81bqkhy.html')] 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG GET https://www.mp4upload.com/embed-x50ng81bqkhy.html 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG {'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5'} 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG ----- 2020-08-22 14:01:28 arch anime_downloader.session[84260] DEBUG cached request 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG https://www.mp4upload.com/embed-x50ng81bqkhy.html 2020-08-22 14:01:28 arch anime_downloader.sites.helpers.request[84260] DEBUG /tmp/animedlm6tlqktt/tmp6fycl4lg internal/modules/cjs/loader.js:1033 throw err; ^ Error: Cannot find module './lib/main' Require stack: - /home/bl/.local/lib/python3.8/site-packages/anime_downloader/node_modules/vm2/index.js - /home/bl/[eval] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15) at Function.Module._load (internal/modules/cjs/loader.js:899:27) at Module.require (internal/modules/cjs/loader.js:1090:19) at require (internal/modules/cjs/helpers.js:75:18) at Object.