Xonshiz / anime-dl

Anime-dl is a command-line program to download anime from CrunchyRoll and Funimation.
MIT License
229 stars 37 forks source link

Feature Request: Downloaded archive list #61

Open axipher opened 6 years ago

axipher commented 6 years ago

Would it be possible to specify a text file argument to save a list of successfully downloaded files as an alternative to checking for the file itself in the Output File. I run anime-dl on a 512 GB SSD alongwide Steam games so space isn't infinite, so I like to move the completed files on to my NAS with Plex once I've renamed the files with Season and Episode numbers. Youtube-dl let's you specify a download archive file, it would be nice if anime-dl let you do something similar and kept track of which episodes were downloaded along with the resolution.

Abu3safeer commented 6 years ago

Seems interesting feature, could you tell me what argument used in youtube-dl? I want to try it.

axipher commented 6 years ago

I use the "--download-archive FILE" argument. I believe I specify the file portion with Single Quotes if there are any spaces in it, but it's really handy as I can throw that argument in the config.txt folder in the AppData folder (or a local config file would work too) that gets called by default for each time I use the program.

So I can have a generic archive text file that just has a list of Site + video ID that gets checked each time a playlist if requested for download instead of having to keep a local copy of the file (anime can use up space really fast...)

Xonshiz commented 5 years ago

I don't completely understand what you meant. But, I'll look into youtube-dl's method and see what can be done.

axipher commented 5 years ago

So one of youtube-dl's command line options is "--download-archive </path/to/file.txt>"

The file will look something like this as you start downloading shows:

crunchyroll 650673
crunchyroll 650675
crunchyroll 650677
crunchyroll 650679

Then every time you invoke youtube-dl with that "--download-archive </path/to/file.txt>" argument, it will check the current video ID against the list and if it already exists, then it just skips it. Very handy for weekly Crunchyroll shows that are currently airing so you only download the latest episode when you run youtube-dl on the show's base URL (no specific episode).

axipher commented 5 years ago

Looking at the DEBUG output (because of another problem) it seems that anime-dl already does grab the Video ID as shown below, at least for Crunchyroll. Could that be used on a site-by-site basis to generate a text file like the following?

anime-dl_crunchyroll_archive.txt (where "crunchyroll" would be replaced with the site name)

crunchyroll 650673
crunchyroll 650675
crunchyroll 650677
crunchyroll 650679

DEBUG Output:

DEBUG: You have successfully set the Debugging On.
DEBUG: Arguments Provided : Namespace(input=['https://www.crunchyroll.com/sword-art-online/episode-19-the-seal-of-the-right-eye-781426'], language='Japanese', password=['<password>'], range='All', resolution='720p', skip=False, username=['<username>'], verbose=True, version=False)
DEBUG: Operating System : Windows - 10 - 10.0.17134
DEBUG: Python Version : 2.7.15 (64bit)
DEBUG: Starting new HTTPS connection (1): www.crunchyroll.com:443
DEBUG: https://www.crunchyroll.com:443 "GET //login HTTP/1.1" 301 None
DEBUG: https://www.crunchyroll.com:443 "GET /login HTTP/1.1" 200 None
DEBUG: https://www.crunchyroll.com:443 "POST //login HTTP/1.1" 301 None
DEBUG: https://www.crunchyroll.com:443 "GET /login HTTP/1.1" 200 None
DEBUG: https://www.crunchyroll.com:443 "GET /sword-art-online/episode-19-the-seal-of-the-right-eye-781426 HTTP/1.1" 200 None
DEBUG: video_id : 781426
DEBUG: info_url : http://www.crunchyroll.com/xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id=781426&video_format=106&video_quality=62&current_page=https://www.crunchyroll.com/sword-art-online/episode-19-the-seal-of-the-right-eye-781426
DEBUG: Starting new HTTP connection (1): www.crunchyroll.com:80
DEBUG: http://www.crunchyroll.com:80 "GET /xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id=781426&video_format=106&video_quality=62&current_page=https://www.crunchyroll.com/sword-art-online/episode-19-the-seal-of-the-right-eye-781426 HTTP/1.1" 301 None
DEBUG: Starting new HTTPS connection (1): www.crunchyroll.com:443
DEBUG: https://www.crunchyroll.com:443 "GET /xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id=781426&video_format=106&video_quality=62&current_page=https://www.crunchyroll.com/sword-art-online/episode-19-the-seal-of-the-right-eye-781426 HTTP/1.1" 200 None
DEBUG: m3u8_file_link : https://dl.v.vrv.co/evs/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DEBUG: anime_name : Sword Art Online Alicization
DEBUG: episode_number : 19
DEBUG: video_resolution : 1280x720
DEBUG: file_name : Sword Art Online Alicization - 19 [1280x720].mp4