Skip to content

Instantly share code, notes, and snippets.

@ch4d1
Forked from fasiha/youtube-dl-crunchyroll.md
Created March 8, 2022 08:53
Show Gist options
  • Save ch4d1/8287ff74a3b1924be850712665e43901 to your computer and use it in GitHub Desktop.
Save ch4d1/8287ff74a3b1924be850712665e43901 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.)

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