scrape subtitles from opensubtitles.org
torrent RSS feed: opensubtitles.org.dump.torrent.rss
- opensubtitles.org.dump.9180519.to.9521948.by.lang.2023.04.26.torrent
- opensubtitles.org.dump.9500000.to.9599999.v20240306.torrent
- opensubtitles.org.dump.9600000.to.9699999.torrent
- opensubtitles.org.dump.9700000.to.9799999.torrent
- opensubtitles.org.dump.9800000.to.9899999.v20240420.torrent
- opensubtitles.org.dump.9900000.to.9999999.v20240609.torrent
- opensubtitles.org.dump.10000000.to.10099999.v20240820.torrent
- opensubtitles.org.dump.10100000.to.10199999.v20241003.torrent
- opensubtitles.org.dump.10200000.to.10299999.v20241124.torrent
- opensubtitles.org.dump.103xxxxx.v20251031.torrent
- opensubtitles.org.dump.104xxxxx.v20260124.torrent
unreleased subs are stored in github.com/milahu/opensubtitles-scraper-new-subs
- download the torrents from section result
- download
subtitles_all.txt.gzfrom https://dl.opensubtitles.org/addons/export/ - run subtitles_all.txt.gz-parse.py to build
subtitles_all.dbpython3 subtitles_all.txt.gz-parse.py subtitles_all.db subz_metadata subtitles_all.txt.gz subtitles_all.txt.gz-parse-errors.txt subtitles_all.txt.gz-parse-debug.txt
- fix the values for
db_pathin local-subtitle-providers.json
run get-subs.py to get subtitles for a movie:
~/src/opensubtitles-scraper/get-subs.py Scary.Movie.2000.mp4
video_path Scary.Movie.2000.mp4
video_filename Scary.Movie.2000.mp4
video_parsed MatchesDict([('title', 'Scary Movie'), ('year', 2000), ('container', 'mp4'), ('mimetype', 'video/mp4'), ('type', 'movie')])
output 'Scary.Movie.2000.en.00018286.sub' from 'Scary_eng.txt' (us-ascii)
output 'Scary.Movie.2000.en.00018615.sub' from 'Scary Movie.txt' (us-ascii)
output 'Scary.Movie.2000.en.00106539.sub' from 'Scary Movie - ENG.txt' (us-ascii)
output 'Scary.Movie.2000.en.00117707.sub' from 'scream_english.sub' (iso-8859-1)
output 'Scary.Movie.2000.en.00203573.sub' from 'Scary Movie - ENG.txt' (us-ascii)
output 'Scary.Movie.2000.en.00204203.sub' from 'Scary Movie_engl.sub' (iso-8859-1)
output 'Scary.Movie.2000.en.03112243.srt' from 'Scary Movie 1 (2000).en.bug-fixed.srt' (Windows-1252)
output 'Scary.Movie.2000.en.03142326.srt' from 'kns-sm.srt' (Windows-1252)
output 'Scary.Movie.2000.en.03279944.srt' from 'Scary Movie 1 iNT DvD RiP- WaCkOs.srt' (Windows-1252)
output 'Scary.Movie.2000.en.03318665.srt' from 'rvlt-scarymovie.srt' (us-ascii)
output 'Scary.Movie.2000.en.03552139.srt' from 'Scary Movie.srt' (us-ascii)
output 'Scary.Movie.2000.en.03686957.sub' from 'Scary.Movie.(2000).DVDRIP.Divx.DOMiNION.sub' (iso-8859-1)
output 'Scary.Movie.2000.en.04867080.srt' from 'Scary.Movie.2000.BrRip.720p.x264.YIFY-eng.srt' (Windows-1252)
output 'Scary.Movie.2000.en.05115082.srt' from 'Scary Movie 1.[2000].UNRATED.DVDRIP.XVID.[Eng]-DUQA®.srt' (Windows-1252)
...
to run your own subtitles server, see docs/wsgi/ to expose get-subs.py as a WSGI script on an HTTP server
- enceladus.feralhosting.com/milahu/bin/get-subtitles (20Gbps uplink)
- milahu.duckdns.org/bin/get-subtitles (40Mbps uplink) (rate-limiting: HTTP 429 Too Many Requests)
see also subtitles-servers.txt
feel free to add your own subtitles server
because i get stupid questions like "but can i use your server...?"
feel free to download a million subtitles every day from my subtitles server, i dont care. i only care about performance issues, in effect "how can i serve more subtitles in less CPU time?"
for example, i could store the database files on SSD drives, but that is too expensive for my taste (FeralHosting Neon - 150 GB SSD - 15 GBP/month = 17.50 EUR/month = 20 USD/month)
to make this faster for yourself, you can just run your own subtitles server, which requires about 200 GB of disk space for all the database files
if you want to create your own subtitles client, then you are probably trying to reinvent the wheel, and you should look at existing opensubtitles clients:
- https://github.com/jellyfin/jellyfin-plugin-opensubtitles
- https://github.com/josdion/subbuzz
- https://github.com/exebetche/vlsub
- https://github.com/emericg/OpenSubtitlesDownload
- https://github.com/QNapi/qnapi
- https://github.com/matcornic/subify
from there it should be trivial to integrate my subtitles server
just please dont hardcode the server URLs,
but instead, store the server URLs in a config file like ~/.config/my-subs-client.yaml,
so users can change the server URLs when my servers go down.
support for multiple subtitles servers should be a first-class feature,
similar to bittorrent trackers
see also docs/integration-with-opensubtitles-mirrors.md
- 5719123 subtitles from opensubtitles.org by
-marked-4life - cloudflare bypassing with commercial scraping services
- bittorrent
useful for subtitle-fetchers like
opensubtitles.org is protected by cloudflare, so im using a scraping proxy (zenrows.com).
with max_concurrency = 10 in fetch-subs.py, one request takes about 0.2 seconds.
videos:
git clone https://github.com/milahu/opensubtitles-scraper
cd opensubtitles-scraper
git submodule update --init
# install dependencies with nix
# https://github.com/NixOS/nix
./shell.nix.sh
# fetch milahu's temporary files to continue scraping
# note: this will fetch all branches
# the "shard branches are called remotes/origin/shards-102xxxxx etc
git clone https://github.com/milahu/opensubtitles-scraper-new-subs
# mount all "shard" branches in opensubtitles-scraper-new-subs/shards/
./opensubtitles-scraper-new-subs/mount-branches.sh
# TODO add your opensubtitles.org VIP accounts here
# so you get subtitles without ads
# so you can 1000 subtitles per day per VIP account
cp fetch_subs_secrets.py.example fetch_subs_secrets.py
$EDITOR fetch_subs_secrets.py
# infinite loop: run the scraper every 6 hours
./main-loop.sh