LATEST UPDATE: COMPLETELY REVISED AND NEWLY WRITTEN SETUP INSTRUCTIONS.
Disclaimer: No support for the tools mentioned. Use at your own risk. VPN usage may cause issues.
Requirements:
- Crunchyroll Account/Subscription: Needed to access and download videos.
- FFMPEG:
- Download from
Code:
https://github.com/yt-dlp/FFmpeg-Builds/releases
- Note: Use the specific FFMPEG version from the provided link.
- Additional information:
Code:
https://github.com/yt-dlp/FFmpeg-Builds
- yt-dlp:
- Primary download from
Code:
https://github.com/yt-dlp/yt-dlp/releases
- Internet Browser: It is recommended to use Firefox, as Chrome might cause problems.
- Link Grabber for Firefox (or your preferred browser): Or any other link grabber you like.
- Batch File, Folders, and Config Setup: To organise the downloads and processes.
Initial Setup Steps:
- Download and extract the necessary tools.
- Create a new folder on your hard drive named yt-dlp.
- Inside the yt-dlp folder, create subfolders named batch, downloads, and ffmpeg.
- Place the yt-dlp.exe file into the yt-dlp folder.
- Extract the contents of the bin from the downloaded FFMPEG archive into the ffmpeg folder within the yt-dlp folder.
Create a file named
config.txt in the
yt-dlp folder and copy-paste the provided configuration settings into the file.
Code:
#Location of the ffmpeg binary
--ffmpeg-location "ffmpeg"
# Print various debugging information - only needed if issues occur and need to be reported on the yt-dlp GitHub page
#--verbose
#Suppress HTTPS certificate validation
--no-check-certificate
#Do not bypass geographic restriction via faking X-Forwarded-For HTTP header. Do not bypass geographic restriction via faking X-Forwarded-For HTTP header
--no-geo-bypass
#Write subtitle file
--write-subs
#Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g.
#--sub-langs "en.*,ja". You can prefix the language code with a "-" to exclude it from
#the requested languages, e.g. --sub-langs all,-live_chat. Use --list-subs for a list of available language tags
--sub-langs en-US
#Limit the filename length (excluding extension) to the specified number of characters
--trim-filenames 200
#Write video description to a .description file
--write-description
#Subtitle format; accepts formats preference, e.g. "srt" or "ass/srt/best"
--sub-format ass
#Number of fragments of a dash/hlsnative video that should be downloaded concurrently (default is 1)
-N 5
#Maximum download rate in bytes per second
--limit-rate 12.0M
#Video format code
-f "b"
#The paths where the files should be downloaded.
-P "downloads"
#Output filename template - you can adjust to your liking - please check the yt-dlp GitHub page for further information
#new naming
-o "%(series)#S/%(season_number)02d - %(season)#S/%(episode_number)02d - %(episode)#S.%(ext)s"
#old naming
#-o "%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s"
#The name of the browser to load cookies from. In this example firefox
--cookies-from-browser firefox
#User Agent
--user-agent "YOUR USER AGENT INFO HERE"
#Remux the video into another container if necessary
--remux-video mkv
#Embed subtitles in the video (only for mp4, webm and mkv videos)
--embed-subs
#default subtitle
--ppa "EmbedSubtitle:-disposition:s:0 default"
#Embed metadata to the video file. Also embeds chapters/infojson if present unless
#--no-embed-chapters/--no-embed-info-json are used (Alias: --add-metadata)
--embed-metadata
#Do not set any "purl" in the video metadata
--parse-metadata ":(?P<meta_purl>)"
#Do not set any "comment" in the video metadata
--parse-metadata ":(?P<meta_comment>)"
#Do not set any "description" in the video metadata
--parse-metadata ":(?P<meta_description>)"
#Do not set any "title" in the video metadata
--parse-metadata ":(?P<meta_title>)"
#Do not set any "episode_id" in the video metadata
--parse-metadata ":(?P<meta_episode_id>)"
#Do not set any "date" in the video metadata
--parse-metadata ":(?P<meta_date>)"
#Do not set any "season_number" in the video metadata
--parse-metadata ":(?P<meta_season_number>)"
#Do not set any "episode_sort" in the video metadata
--parse-metadata ":(?P<meta_episode_sort>)"
#Do not embed the infojson as an attachment to the video file
--no-embed-info-json
#Do not retrieve video comments unless the extraction is known to be quick
--no-write-comments
#Add chapter markers to the video file
--embed-chapters
#Number of seconds to sleep before each download.
#--sleep-interval 5
#Maximum number of seconds to sleep
#--max-sleep-interval 10
#Number of seconds to sleep before each subtitle download
#--sleep-subtitles 2
Please create a file named
crunchyroll_download.bat in the
yt-dlp folder
.
Then, please copy the following text and paste it into the newly created .bat file. Remember to save the file after pasting the text.
Code:
ECHO OFF
CLS
:MENU
ECHO.
ECHO ...............................................
ECHO Download Crunchyroll
ECHO ...............................................
ECHO.
ECHO 1 - Download via URL
ECHO 2 - Download via BATCH file
ECHO 3 - Check available Subtitle Languages and Video Formats/Resolutions
ECHO 4 - Check update for YT-DLP
ECHO 5 - Check YT-DLP version on your system and current version available online
ECHO 6 - Clear the YT-DLP cache folder
ECHO 7 - EXIT
ECHO.
SET /P M=Type 1, 2, 3, 4, 5, 6 or 7 then press ENTER:
IF %M%==1 GOTO URL
IF %M%==2 GOTO BATCH
IF %M%==3 GOTO SUBTITLE
IF %M%==4 GOTO UPDATE
IF %M%==5 GOTO VERSION
IF %M%==6 GOTO CLEAR
IF %M%==7 GOTO EOF
ECHO.
ECHO %M% is not a valid input.
GOTO MENU
:URL
CLS
ECHO ...............................................
ECHO Download via URL
ECHO ...............................................
ECHO.
SET /P URL="[Enter the video URL of the video to download] "
yt-dlp.exe --config-locations "config.txt" "%URL%"
ECHO ...............................................
ECHO Done.
PAUSE
CLS
GOTO MENU
:BATCH
CLS
ECHO ...............................................
ECHO Download via BATCH file
ECHO ...............................................
ECHO.
@echo off
CLS
setlocal enabledelayedexpansion
:input
set count=100
for /f "delims=" %%a in ('dir /b batch') do (
set /a count+=1
echo !count:~-2!] %%a
)
set /a countMax=count-100
set "countNr=%count:~-2%"
ECHO.
<nul set /p "=Enter the number of the batch file to use: (01...%countNr%, 00 for Menu): "
choice /c 1234567890 /n >nul
set first=%errorlevel:~-1%
<nul set /p "=%first%"
choice /c 1234567890 /n >nul
echo %errorlevel:~-1%
set ch=%first%%errorlevel:~-1%
REM echo that was %ch%
set /a line=1%ch%-101
if "%ch%" == "00" goto escape
if %ch% gtr %countMax% echo bad input&goto :input
for /f "delims=" %%a in ('dir /b batch^|more +%line%') do set "file=%%a"&goto :cont
:cont
ECHO.
echo You selected: %ch% - %file%
ECHO.
echo Task started for batch file: %file%.
ECHO.
yt-dlp.exe --config-locations "config.txt" --batch-file "batch\%file%"
PAUSE
CLS
GOTO MENU
:escape
echo you choose '00' for exit.
GOTO MENU
:UPDATE
CLS
ECHO ...............................................
ECHO Check nightly update for YT-DLP
ECHO ...............................................
ECHO.
yt-dlp.exe --update-to nightly
PAUSE
CLS
GOTO MENU
:SUBTITLE
CLS
ECHO ...............................................
ECHO Check available Subtitle Languages and Video Formats/Resolutions
ECHO ...............................................
ECHO.
SET /P URL="[Enter the video URL to check available Subtitle Languages and Video Formats/Resolutions] "
yt-dlp.exe --verbose --no-check-certificate --no-geo-bypass --list-subs --list-formats --user-agent "MY_USER_AGENT" --cookies-from-browser firefox "%URL%"
ECHO ...............................................
ECHO Done.
PAUSE
CLS
GOTO MENU
:VERSION
CLS
ECHO ...............................................
ECHO Check YT-DLP version on your system
ECHO and current version available online
ECHO ...............................................
ECHO.
yt-dlp.exe --version
PAUSE
CLS
GOTO MENU
:CLEAR
CLS
ECHO ...............................................
ECHO Clear the YT-DLP cache folder
ECHO ...............................................
ECHO.
yt-dlp.exe --rm-cache-dir
PAUSE
CLS
GOTO MENU
The cookies and the browser user agent must be from the same source.
For example, if you use cookies from Microsoft Edge, you cannot use a Firefox user agent. This mismatch will lead to an Error 403.
Complete user agent information is required. Providing partial information, such as only 'Firefox' in the user agent, will also result in an Error 403.
Keep the user agent information updated. If your browser receives an update, you need to update the user agent information in the script accordingly to avoid an Error 403.
To find your browser's user agent information, go to Google and type 'What's my user agent'. This will display your current browser's user agent. For example, a sample user agent for Google Chrome might look like this:
Code:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
Remember, this is just an example. Your user agent will vary based on your browser, version, and operating system.
After obtaining your browser's user agent information by searching 'What's my user agent' on Google, you need to update two files: config.txt and crunchyroll_download.bat. Find the placeholder MY_USER_AGENT in both files and replace it with your actual user agent information. For example, if your user agent is
Code:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
, replace MY_USER_AGENT with this string in both files within the " ".
It is crucial to keep this information up to date. Every time your browser receives an update, you must check and update the user agent in these files accordingly. Failing to do so may result in the script not functioning correctly, as the user agent must match the current version of your browser.
Please note that the cookies used in this process have a limited lifespan and will expire after 30 minutes. Additionally, it's important to be aware that some browsers require you to close them to access the cookies. Ensure you retrieve the cookies promptly and update them as needed for the script to function effectively.
To download episodes in batch, use a link grabber extension within your preferred browser to capture the episode links.
Then, copy these links into a text file and place it inside the '
batch' folder.
It's recommended to name the text file after the series title for easy identification. Please note that the menu can handle a
maximum of
99 text files.
IMPORTANT:
Please remember to play an episode before downloading to obtain the necessary cookies.
This step needs to be repeated each time the cookies expire.