Code Monkey home page Code Monkey logo

subtitle-downloader's Introduction

Subtitle Downloader

zh python

NON-COMMERCIAL USE ONLY

Subtitle-Downloader supports downloading subtitles from multiple streaming services, such as Apple TV+, CatchPlay, Disney+, FridayVideo, HBO GO Asia, iQIYI, iTunes, KKTV, LINE TV, meWATCH, MyVideo, NowE, NowPlayer, Viki, Viu, WeTV, YouTube, and etc.

DESCRIPTION

Subtitle-Downloader is a command-line program to download subtitles from the most popular streaming platform. It requires Python 3.8+, and NodeJS. It should work on Linux, on Windows or on macOS. This project is only for personal research and language learning.

INSTALLATION

  • Linux, macOS:
pip install -r requriements
  • Windows: Execute install_requirements.bat

Service Requirements

Name Authentication Geo-blocking
Apple TV+ Cookies
CatchPlay Cookies Indonesia, Singapore, and Taiwan
Disney+ Email & Password
Friday Video Cookies Taiwan
HBO GO Asia Email & Password
iQIYI (iq.com) Cookies Partial region
iTunes
KKTV
LINE TV
MeWATCH Email & Password Singapore
MyVideo Cookies Taiwan
NowE Cookies
Now Player Cookies
Viki Cookies Partial region
Viu
WeTV Cookies Partial region
YouTube Cookies (Subscribe channel)

Get Cookies

  1. Install Chrome plugin: get-cookiestxt-locally
  2. Login to the streaming service, and use the plugin to download cookies.txt (Don't modify anything even the file name)
  3. Put cookie.txt into Subtitle-Downloader/cookies

Email & Password

  • Fill your email and password in Subtitle-Downloader/user_config.toml

USAGE

Online (Colab environment is in the US, if you want to use in other region please execute on local)

  1. Save a copy in Drive
  2. Connect Colab
  3. Install the requirements (Click 1st play button)
  4. Depend the download platform and modify the text field (Cick the play button next to it when modified complete)
  5. Download the subtitles from the left side menu

Colab

Local

  1. Depend on download platform and modify Subtitle-Downloader/user_config.toml

    [subtitles]
    default-language = 'en'
    default-format = '.srt'
    
    [headers]
    User-Agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36'
    
    [credentials.DisneyPlus]
    email = ''
    password = ''
    
    [proxies]
    us = 'http:127.0.0.1:7890' # Clash
    
    [nordvpn]
    username = ''
    password = ''
  2. Follow each platform requirements and put cookies.txt into Subtitle-Downloader/cookies

  3. Execute the program with command line or Subtitle-Downloader.bat (Paste title url)

    python subtitle_downloader.py URL [OPTIONS]

OPTIONS

  -h, --help                    show this help message and exit

  -s --season                   download season [0-9]

  -e --episode                  download episode [0-9]

  -l, --last-episode            download last episode

  -o, --output                  output directory

  -slang, --subtitle-language   languages of subtitles; use commas to separate multiple languages
                                default: Traditional Chinese
                                all: download all available languages

  -alang, --audio-language      languages of audio-tracks; use commas to separate multiple languages

  -sf, --subtitle-format        subtitles format: .srt or .ass

  -locale, --locale             interface language

  -p, --proxy                   proxy

  -d, --debug                   enable debug logging

  -v, --version                 app's version

Subtitle Languages

Disney+

Codec Language
en English [CC]
zh-Hant Chinese (Traditional)
zh-Hans Chinese (Simplified)
zh-HK Cantonese
da Dansk
de Deutsch
de-forced Deutsch [forced]
es-ES Español
es-ES-forced Español [forced]
es-419 Español (Latinoamericano)
es-419-forced Español (Latinoamericano) [forced]
fr-FR Français
fr-FR-forced Français [forced]
fr-CA Français (Canadien)
fr-CA-forced Français (Canadien) [forced]
it Italiano
it-forced Italiano [forced]
ja Japanese
ja-forced Japanese [forced]
ko Korean
ko-forced Korean [forced]
nl Nederlands
no Norsk
pl Polski
pl-forced Polski [forced]
pt-PT Português
pt-BR Português (Brasil)
pt-BR-forced Português (Brasil) [forced]
fi Suomi
sv Svenska

HBO GO Asia

Codec Language
en English
zh-Hant Traditional Chinese
zh-Hans Simplified Chinese
ms Malay
th Thai
id Indonesian

iQIYI iq.com

Codec Language
en English
zh-Hant Traditional Chinese
zh-Hans Simplified Chinese
ms Malay
vi Vietnamese
th Thai
id Indonesian
es Spanish
ko Korean
ar Arabic

Viu

Codec Language
en English
zh-Hant Traditional Chinese
zh-Hans Simplified Chinese
ms Malay
th Thai
id Indonesian
my Burmese

WeTV

Codec Language
en English
zh-Hant Traditional Chinese
zh-Hans Simplified Chinese
ms
th Thai
id Indonesian
pt Português
es Spanish
ko Korean

Now E, Now Player

  • Copy user-agent from login browser https://www.whatsmyua.info/ and paste it in Subtitle-Downloader/user_config.toml (User-Agent). The user-agent must be same as login browser user-agent.

More Examples

  • Download all seasons and all episodes
python subtitle_downloader.py URL
  • Download season 1 episode 1
python subtitle_downloader.py URL -s 1 -e 1
  • Download season 1 episode 1's subtitle with all langugages
python subtitle_downloader.py URL -s 1 -e 1 -slang all
  • Download all episodes subtitles with all langugages: en, zh-Hant
python subtitle_downloader.py https://www.disneyplus.com/series/loki/6pARMvILBGzF -slang en,zh-Hant
  • Download latest episode
python subtitle_downloader.py URL -l
  • Download season 1 episode 1-10
python subtitle_downloader.py URL -s 1 -e 1-10
  • Download season 1 episode 1,3,5
python subtitle_downloader.py URL -s 1 -e 1,3,5
  • Download season 1 episodes with NordVPN (region=tw)
python subtitle_downloader.py URL -s 1 -p tw
  • Download season 1 episodes with proxy (Clash)
python subtitle_downloader.py URL -s 1 -p http:127.0.0.1:7890
  • Download season 1 episodes with .ass format subtitle
python subtitle_downloader.py URL -s 1 -sf .ass

NOTICE

  • Few streaming services have Geo-blocking, make sure you are in the same region or use a proxy to bypass restrictions.
  • Disney+ doesn't support VPN.
  • Viki has API protection, don't call API too often. (Only catch 100% completed subtitles)

FAQ

  • Any issue during downloading subtitles, upload the screenshot and log file (Please provide title, platform and region).
  • Make sure the video contains embedded subtitles (subtitles able to turn on-off) and it is playable in your region.

Support & Contributions

  • Please ⭐️ this repository if this project helped you!
  • Contributions of any kind welcome!

Buy Me A Coffee

Appendix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.