anime-dl / anime-downloader

A simple but powerful anime downloader and streamer.
The Unlicense
1.92k stars 218 forks source link

Some sources' download result in '[Errno 13] Permission denied: 'node'' #564

Closed DennisHakvoort closed 3 years ago

DennisHakvoort commented 3 years ago

Description When downloading from some sources, the download results in the error "[Errno 13] Permission denied: 'node'". One of the soruces is 'animerush'.

To reproduce The following command seems to result in this error for me.

anime dl https://www.animerush.tv/anime/nichijou/
LOG ``` 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.util[5160] INFO anime-downloader 5.0.1 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.util[5160] DEBUG Platform: Linux-4.19.104-microsoft-standard-x86_64-with-glibc2.29 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.util[5160] DEBUG Python 3.8.2 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.anime[5160] INFO Extracting episode info from page 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG GET https://www.animerush.tv/anime/nichijou/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20'} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.session[5160] DEBUG cached request 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG https://www.animerush.tv/anime/nichijou/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG /tmp/animedlyommpp30/tmp8c2a36bh 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG GET https://www.animerush.tv/anime/nichijou/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20'} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.session[5160] DEBUG cached request 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG https://www.animerush.tv/anime/nichijou/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG /tmp/animedlyommpp30/tmpwim0l_d5 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.anime[5160] DEBUG EPISODE IDS: length: 27, ids: ['https://www.animerush.tv/nichijou-episode-0/', 'https://www.animerush.tv/nichijou-episode-1/', 'https://www.animerush.tv/nichijou-episode-2/', 'https://www.animerush.tv/nichijou-episode-3/', 'https://www.animerush.tv/nichijou-episode-4/', 'https://www.animerush.tv/nichijou-episode-5/', 'https://www.animerush.tv/nichijou-episode-6/', 'https://www.animerush.tv/nichijou-episode-7/', 'https://www.animerush.tv/nichijou-episode-8/', 'https://www.animerush.tv/nichijou-episode-9/', 'https://www.animerush.tv/nichijou-episode-10/', 'https://www.animerush.tv/nichijou-episode-11/', 'https://www.animerush.tv/nichijou-episode-12/', 'https://www.animerush.tv/nichijou-episode-13/', 'https://www.animerush.tv/nichijou-episode-14/', 'https://www.animerush.tv/nichijou-episode-15/', 'https://www.animerush.tv/nichijou-episode-16/', 'https://www.animerush.tv/nichijou-episode-17/', 'https://www.animerush.tv/nichijou-episode-18/', 'https://www.animerush.tv/nichijou-episode-19/', 'https://www.animerush.tv/nichijou-episode-20/', 'https://www.animerush.tv/nichijou-episode-21/', 'https://www.animerush.tv/nichijou-episode-22/', 'https://www.animerush.tv/nichijou-episode-23/', 'https://www.animerush.tv/nichijou-episode-24/', 'https://www.animerush.tv/nichijou-episode-25/', 'https://www.animerush.tv/nichijou-episode-26/'] 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.commands.dl[5160] INFO Found anime: Nichijou 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.commands.dl[5160] INFO Downloading to /mnt/c/programming/Python_anime_downloader 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.anime[5160] DEBUG Extracting stream info of id: https://www.animerush.tv/nichijou-episode-0/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG GET https://www.animerush.tv/nichijou-episode-0/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20'} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.session[5160] DEBUG cached request 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG https://www.animerush.tv/nichijou-episode-0/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG /tmp/animedlyommpp30/tmpuv5ekmy4 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG GET https://www.animerush.tv/nichijou-episode-0/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20'} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.session[5160] DEBUG cached request 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG https://www.animerush.tv/nichijou-episode-0/ 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG /tmp/animedlyommpp30/tmpilnawx0w 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.animerush[5160] DEBUG Sources: [['https://mp4upload.com/embed-ve5ixds3pvcn-650x370.html', 'MP4Upload']] 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.anime[5160] DEBUG Data : [{'extractor': 'mp4upload', 'url': 'https://mp4upload.com/embed-ve5ixds3pvcn-650x370.html', 'server': 'MP4Upload', 'version': 'subbed'}] 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.anime[5160] DEBUG Sorted sources : [{'extractor': 'mp4upload', 'url': 'https://mp4upload.com/embed-ve5ixds3pvcn-650x370.html', 'server': 'MP4Upload', 'version': 'subbed'}] 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.anime[5160] DEBUG Sources : [('mp4upload', 'https://mp4upload.com/embed-ve5ixds3pvcn-650x370.html')] 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG GET https://mp4upload.com/embed-ve5ixds3pvcn-650x370.html 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20'} 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG ----- 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.session[5160] DEBUG cached request 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG https://www.mp4upload.com/embed-ve5ixds3pvcn-650x370.html 2020-10-26 20:50:23 DESKTOP-K4C6R3T anime_downloader.sites.helpers.request[5160] DEBUG /tmp/animedlyommpp30/tmpt1k8d9dy Traceback (most recent call last): File "/mnt/c/programming/Python_anime_downloader/env/venv/bin/anime", line 8, in sys.exit(main()) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/cli.py", line 53, in main cli() File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/commands/dl.py", line 123, in command for episode in animes: File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/sites/anime.py", line 198, in __iter__ yield episode_class(ep_id[1], parent=self, ep_no=ep_id[0]) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/sites/anime.py", line 295, in __init__ try_data() File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/sites/anime.py", line 293, in try_data self.source().stream_url File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/extractors/base_extractor.py", line 32, in stream_url self.get_data() File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/extractors/base_extractor.py", line 44, in get_data data = self._get_data() File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/extractors/mp4upload.py", line 20, in _get_data script = util.deobfuscate_packed_js(script) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/util.py", line 329, in deobfuscate_packed_js return eval_in_node('eval=console.log; ' + packedjs) File "/mnt/c/programming/Python_anime_downloader/env/venv/lib/python3.8/site-packages/anime_downloader/util.py", line 334, in eval_in_node output = subprocess.check_output(['node', '-e', js]) File "/usr/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 489, in run with Popen(*popenargs, **kwargs) as process: File "/usr/lib/python3.8/subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: 'node' ```
DennisHakvoort commented 3 years ago

I found the following in the readme of this project. Please add these notes to your documentation site as well, it's not listed there. I'm pretty sure this is the issue. I'll try out and close the issue if this is indeed the case,

For Cloudflare scraping either cfscrape or selenium is used. Cfscrape depends on node-js and selenium utilizes an automated invisible instance of a browser (chrome/firefox). So, if you want to use Cloudflare enabled sites, make sure you have node-js and a webdriver installed.

DennisHakvoort commented 3 years ago

That was the solution. I'm closing this issue.