Giter Site home page Giter Site logo

rafayghafoor / subscene-subtitle-grabber Goto Github PK

View Code? Open in Web Editor NEW
114.0 5.0 24.0 195 KB

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

Python 98.99% Batchfile 1.01%
download-subtitles subtitles-search python subscene opensubtitles

subscene-subtitle-grabber's Introduction

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.

subscene-subtitle-grabber's People

Contributors

jayvdb avatar rafayghafoor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

subscene-subtitle-grabber's Issues

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

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!

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

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.

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'

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'

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.