Skip to content

Instantly share code, notes, and snippets.

@fasiha
Last active October 12, 2024 00:16
Show Gist options
  • Save fasiha/3cde9ab6d2fec66f6df9c553554d63ed to your computer and use it in GitHub Desktop.
Save fasiha/3cde9ab6d2fec66f6df9c553554d63ed to your computer and use it in GitHub Desktop.
Youtube-dl with Crunchyroll

Get the following:

  • a Crunchyroll account (though they let you watch/download some videos without an account, at 480p),
  • the latest youtube-dl (brew upgrade youtube-dl),
  • your browser’s user agent,
  • your Crunchyroll cookies (cookie.txt export for Chrome is handy) into a cookies.txt file.

Then,

$ youtube-dl "http://www.crunchyroll.com/recovery-of-an-mmo-junkie/episode-4-like-a-maiden-in-love-749529" \
    --all-subs \
    -u "ENTER_EMAIL_ADDRESS" \
    -p "ENTER_PASSWORD" \
    --user-agent "ENTER_USER_AGENT" \
    --cookies cookies.txt

If an error related to the cookies file is thrown, note: I had to replace all the decimal expiration timestamps in cookies.txt with the integer versions (so 123.456 becomes 123), and be sure to add # Netscape HTTP Cookie File to the top (source).

If VLC cannot display the subtitles, it may be because the font used in the ASS subtitle file is for some reason unavailable, i.e., Trebuchet MS on macOS. Option 1: add --sub-format "srt" flag to the youtube-dl invocation to get dumb SRT subtitles (no styles, no speaker information, etc.). Option 2: edit the ASS file and replace the offending fonts with other ones (e.g., Trebuchet MS to Avenir on macOS). (Also useful for this issue: --skip-download will skip downloading the video and only download the subtitles.)

@fasiha
Copy link
Author

fasiha commented Jul 28, 2023

@Bhavya031 hmm, my first instinct would be to try yt-dlp (their "known issues" thread suggests Crunchyroll should work with it)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment