SubGrab is a utility that allows you to automate subtitles downloading for your media files.

Overview

SubGrab - Command-line Subtitles Downloader:

Downloads

A utility which provides an ease for automating media i.e., Movies, TV-Series subtitle scraping from multiple providers.

Index:

Status/Version:

  • Current Version: 1.0.4

Installation:

pip install subgrab

Preview:

asciicast

Providers Supported:

Following sites can be used for subtitle downloading:

Supported Sites
SUBSCENE (-m)
ALLSUBDB (default for directories)

Usage:

Usage:

subgrab [-h] [-d directory path] [-m Name of the movie/season] [-s Silent Mode]
                   [-c Number of Subtitles to be downloaded] [-l Custom language]

Options:

  -h, --help            Show this help message and exit.

  -d DIR, --dir DIR     Specify directory to work in.

  -m MOVIE_NAME [MOVIE_NAME ...], --movie-name MOVIE_NAME [MOVIE_NAME ...]
                        Provide Movie Name.

  -s, --silent          Silent mode.

  -c COUNT, --count COUNT
                        Number of subtitles to be downloaded.

  -l LANG, --lang LANG  Change language.

Examples:

subgrab                             # To run in current working directory.

subgrab -m Doctor Strange           # For custom movie subtitle download.

subgrab -m Doctor Strange -s        # Silent mode (No prompts i.e., title selection [if not found]).

subgrab -d "DIRECTORY_PATH"         # For specific directory.

subgrab -m The Intern 2015 -s -l AR # Language specified (First two characters of the language).

subgrab -m The Intern 2015 -c 3 -s  # Download 3 subtitles for the movie.

Changelog:

Note:

  • (For Windows) To use it from the context menu, paste subtitle.bat file in "shell:sendto" (By typing this in RUN). Taken from Manojmj subtitles script.

Features:

  • Two Mode (CLI and Silent inside individual media downloading [-m]) - CLI mode is executed when the title (provided i.e. media name) is not recognized by the site. Mostly when year is not provied (when two or more media names collide). Silent mode is usually executed when year is provided in the argument. Optional, you can also specify silent mode argument - which forces to download subtitles without title selection prompt. The media argument (-m) followed by the silent mode (-s) argument forces silent mode.

  • Subtitles count argument added which allows you to download multiple subtitles for an individual media. This is useful when the exact match is not found and you can download multiple srt files and check them if they are in sync with the media file (integrated in v0.12).

  • Added multiple languages support (v0.12).

  • Allows you to download subtitles for movies by specifying movie name and year (optional).

  • Allows you to download subtitles for media files in a specified directory.

  • Cross-platform (Tested on Linux and Windows).

  • Logs generation on script execution (v0.15)

  • Added Support for the SubDb (v0.16), now first preference for downloading subtitles is SubDB in downloading subtitles from a directory.

  • Initial release (v1.0.0)

TODO:

  • Adding support for more languages.
  • Adding flags.
  • Support for AllSubDB .
  • Support for OpenSubtitles, YifySubtitles.
  • Auto-Sync subtitle naming with the media file when downloaded from subscene.
  • A GUI box which creates a dialogue box (consisting of tick and cross), which waits for the user to check if the subtitle downloaded is synchronized with media file or not - if clicked cross, downloads another subtitle (Process gets repeated unless, correctly synchronized).
  • Watch-folder feature (runs as a service). # Useful for movies automatically downloaded on servers.
  • Argument handling (Replace Argsparse with Click).
  • Using Tabulate for monitoring directory subtitle downloading progress. Three Columns [#, Movie_Folder, Status].
  • Better Logging.
  • Download subtitles for movies contained in a directory of X year.
  • Adding silent mode for downloading subtitles.
  • Adding CLI mode for manually downloading subtitles.
  • Implement Logging.
  • Implementation for seasons episodes.
  • Different search algorithms implementation for precise results.
  • Improving CLI Mode by displaying the menu according to the site.
  • Multiple subtitle language support also associated with the count variable.
For example:
>>> subgrab -m Doctor Strange -s -l AR, EN, SP -c 3
should download 3 subtitles for each language specified
  • An option to print list of movies which has subtitles.
  • Creating options in context menu.
  • Display menu which enables to download subtitles for selected directories. (Supporting ranges)
For Examples:
(0) Movie 1
(1) Movie 2
.
.
(10) Movie 10
------------------------------------------------------------------------------------------------------
(Interactive Prompt)
> 1-3, 6,7,10

will download subtitles for the directories specified.
Comments
  • FileNotFoundError: [Errno 2] No such file or directory: '/root/.local/share/Subgrab'

    FileNotFoundError: [Errno 2] No such file or directory: '/root/.local/share/Subgrab'

    ` root@omvpi:/media# subgrab Traceback (most recent call last): File "/usr/local/bin/subgrab", line 5, in from subgrab.cli import main File "/usr/local/lib/python3.8/site-packages/subgrab/cli.py", line 23, in os.mkdir(log_directory) FileNotFoundError: [Errno 2] No such file or directory: '/root/.local/share/Subgrab'

    `

    help wanted 
    opened by ialqwaiz 4
  • Does NOT work on Linux

    Does NOT work on Linux

    Hi there! when I try to call your package, I got this:

    subgrab -m Doctor Strange File "", line 1 subgrab -m Doctor Strange ^ SyntaxError: invalid syntax

    help wanted 
    opened by msfoxofficial 4
  • Cant run subgrab

    Cant run subgrab

    root@sonarr:~ # subgrab Traceback (most recent call last): File "/usr/local/bin/subgrab", line 11, in load_entry_point('subgrab==0.16', 'console_scripts', 'subgrab')() File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 563, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2651, in load_entry_point return ep.load() File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2305, in load return self.resolve() File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2311, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/local/lib/python2.7/site-packages/subgrab-0.16-py2.7.egg/subgrab/main.py", line 1, in from .SubGrab import main File "/usr/local/lib/python2.7/site-packages/subgrab-0.16-py2.7.egg/subgrab/SubGrab.py", line 14, in os.mkdir(log_directory) OSError: [Errno 2] No such file or directory: '/root/.local/share/Subgrab'

    help wanted 
    opened by seed1234 3
  • Not working :(

    Not working :(

    Hi, none of the Hello World examples seem to be working. Starting subgrab (without any commands) runs forever until I force a close with [Ctrl]+[C]. Starting subgrab to search something immediately returns with an empty line. I am using Python 3 and Windows. I tested subgrab with the default command line and cygwin and both in normal mode and with administrative rights.

    question 
    opened by r0f1 2
  • KeyError: 'FR' issue

    KeyError: 'FR' issue

    Hi, I've run this command, which generate an error message, could you please tell me how to fix it?

    subgrab -l FR
    Traceback (most recent call last):
      File "/home/hista/.local/bin/subgrab", line 10, in <module>
        sys.exit(main())
      File "/home/hista/.local/lib/python2.7/site-packages/subgrab/SubGrab.py", line 73, in main
        subscene.DEFAULT_LANG = subscene.LANGUAGE[args.lang.upper()]
    KeyError: 'FR'
    
    help wanted 
    opened by hista 1
  • subtitle language

    subtitle language

    Hi, hope to see the new release soon :)

    I chose the arabic language but the downloaded subtitle files are in english... The command is as follows subgrab -d /media/Legion/Season.1/Legion.S01E01.720p.HDTV.x265.ShAaNiG/ -l ar

    wontfix 
    opened by ialqwaiz 1
  • seems the search result does not show exact, close and tv series section of subscene.com

    seems the search result does not show exact, close and tv series section of subscene.com

    Please compare your result with subscene.com. subgrab -m joker or subgrab -m joker 2019 It seems your script just shows the popular result of subscene.com. By the way, if subscene.com shows the movie in the exact section, so your script will miss it.

    enhancement 
    opened by msfoxofficial 1
  • Difference to other solutions

    Difference to other solutions

    Hey there, thank you for this project. Always looking forward to see something like that. However i wanted to ask if you know https://github.com/Diaoul/subliminal or https://github.com/caronc/nzbget-subliminal and what specifially your library can provide what they can't ?

    question 
    opened by eikaramba 1
  • Added functionality for ranges of movies in cli mode

    Added functionality for ranges of movies in cli mode

    Instead of only picking a single movie from the list of results, I changed the functionality so that users can select multiple movies using '-' for a range and ',' for unique numbers. For example:

    Please Enter Movie Number: 0, 2-7 downloads movies 0, 2, 3, 4, 5, 6 and 7.

    opened by tsepuri 0
  • Cloudflare checking browser, Subscene query returning E503

    Cloudflare checking browser, Subscene query returning E503

    Hi, recently subgrab stopped working for me. Today I digged a bit into what's wrong and after enabling DEBUG logging level, I got:

    $ subgrab -m Titanic
    DEBUG:SubGrab:Input with flags: ['subgrab', '-m', 'Titanic']
    INFO:SubGrab:Initialized SubGrab script
    INFO:SubGrab:Set Language: EN
    INFO:SubGrab:Searching For: Titanic
    INFO:subscene.py:Selecting title for name: Titanic
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): subscene.com:443
    DEBUG:urllib3.connectionpool:https://subscene.com:443 "GET /subtitles/searchbytitle?query=Titanic HTTP/1.1" 503 None
    DEBUG:subscene.py:https://subscene.com/subtitles/searchbytitle?query=Titanic not retrieved.
    INFO:subscene.py:Searching in query: https://subscene.com/subtitles/searchbytitle/?query=Titanic
    DEBUG:subscene.py:Returning - 'NoneType' object has no attribute 'find'
    INFO:SubGrab:Subtitle Link for Titanic : None
    

    I guess this is due to some protection mechanisms being enforced by subscene server, right? This is also evident when you go to subscene.com via browser, before loading the webpage, there is a banner saying

    Checking your browser before accessing subscene.com. This process is automatic. Your browser will redirect to your requested content shortly. Please allow up to 5 seconds… DDoS protection by Cloudflare

    Is anyone going to fix this somehow and is that even possible? Also, is it possible to use ALLSUBDB backend without actually computing the movie hash from media file, only using movie title?

    Thanks!

    bug 
    opened by radek555 5
Owner
Rafay
Cogito, ergo sum
Rafay
Utility for downloading works from AO3 (Archive Of Our Own)

ao3d video preview A small graphical utility for batch downloading works from AO3 (Archive Of Our Own) Features Batch downloading works to supported f

flux 24 Dec 9, 2022
Utility for downloading works from AO3 (Archive Of Our Own)

froyo A small graphical application for batch downloading works from Archive Of Our Own (AO3). Curate a fic repo of your own today :) Features Batch d

flux 24 Dec 9, 2022
A Celery application to collect data, download media and extract information from social media APIs

Project IBEX A Celery application to collect data, download media and extract information from social media APIs. Requirements You must have a Redis D

ibex 4 Dec 15, 2022
A simple Python program which uses youtube-dl for downloading YouTube videos as mp3 files.

yt-mp3 converter This is a simple Python program which uses youtube-dl for downloading YouTube videos as mp3 files. This program is for you if you are

nostalgicnerdpenguin 1 Oct 24, 2021
A discord bot for downloading youtube video and audio files

disctube disctube is a discord bot for downloading video and audio files from youtube using python pytube. disclaimer i am not the best python program

razor420 3 Feb 3, 2022
Storing, versioning, and downloading files from S3 made as easy as using open() in Python. Caching included.

open(LARGE) Storing, versioning, and downloading files from S3 made as easy as using open() in Python. Caching included. Motivation Oftentimes, especi

András Schmelczer 2 Jan 30, 2022
A YouTube downloader which allows you to choose which video you want

Youtube Video Downloader Download multiple videos in one go! How to Use 1.First type the video you want to download 2.On clicking the Search button yo

null 2 Dec 17, 2021
Making the process of downloading youtube videos faster and more convinient.

Easy-YT Making the process of downloading youtube videos faster and more convinient. What can it do? This python script can be used to download youtub

Meynam 39 Nov 15, 2021
This script fully automates of downloading tiktok videos, editing them,compiling them and finally uploading them to youtube.

This script fully automates of downloading tiktok videos, editing them,compiling them and finally uploading them to youtube. If you wanted to create a tiktok video compiilation youtubbe channel this script is here to help you :D

Supriyo Sarkar 32 Dec 16, 2022
ImageScraper is a cross-platform tool for downloading a specified count from xkcd, Astronomy Picture of the Day and Existential Comics

ImageScraper The ImageScraper is a cross-platform tool for downloading a specified count from xkcd, Astronomy Picture of the Day and Existential Comic

1amnobody 1 Jan 25, 2022
This is a tool to allow downloading any links from r/Roms Magethread

ILYFPR This is a tool to allow downloading any links from r/Roms Magethread Limitations: It downloads ALL roms of the system you choose. This will be

Erase 4 Nov 4, 2021
Userscript qutebrowser for downloading audio / video from youtube using aria2

Yt-Downloader Userscript qutebrowser for downloading video / audio from youtube using aria2 by hint links. Requirements Rofi youtube-dl aria2 dunst In

Ara 0 Dec 11, 2021
A very fast file streaming bot used for streaming and downloading movies

FileStreamBot GIVE A STAR AND FORK ELSE NO MORE OPENSOURCE A Telegram bot to turn all media and documents files to web link . Report a Bug | Request F

Code X Mania a.k.a Adarsh Goel 190 Jan 4, 2023
Python script for downloading audio from YouTube songs/videos.

Python script for downloading audio from YouTube songs/videos. All you have to do is specify the path to your folder and then type song's/video's name and the sound will be downloaded into your folder.

Mateusz Polis 0 Oct 5, 2022
A web app for downloading Facebook comments as a csv file

Facebook Comment Downloader A small web app for downloading comments from a public facebook page post. Comment downloading from https://github.com/min

WSDOT 23 Jan 4, 2023
Gogoanime-dl - Gogoanime downloader for downloading anime.

gogoanime-dl With this script, you can download episodes of your favorite anime from Gogoanime. The current site that's developed against is https://w

null 1 Jan 6, 2022
A Python package for downloading / archiving all available episodes from a podcast RSS feed.

allcasts ?? ?? A Python package for downloading all available episodes from a podcast RSS feed. Useful for making private archives of your favourite p

Lewis Gentle 5 Nov 20, 2022
A simple python script and it's used for mp4 type video downloading from youtube.

This is a simple python script and it's used for mp4 type video downloading from youtube. also, it's used inbuilt python module pytube. Furthermore, I know we have so many apps and online websites to do the same thing so it's just an experiment to study how to do those things in python.

Yousaf K Hamza 1 Jan 10, 2022
Heroic-gogdl - GOG Downloading module for Heroic Games Launcher

heroic-gogdl GOG download module for Heroic Games Launcher Purpose This will tak

Paweł Lidwin 36 Dec 23, 2022