Giter VIP home page Giter VIP logo

subtitle-downloader's Introduction

Subtitle Downloader

Python script to download english & Arabic subtitles of any movie/tv series episode.

Get the latest version of Python at http://www.python.org/getit/.

Usage:

If you have python in your path, simply drag and drop files and folders you wish to get subtitles from on subtitle-downloader.py

Windows:

  • Install Python Follow the steps at http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7 to set the python path.

  • install click, requests, bs4 libraries

        pip install click requests bs4
    
  • Place subtitle-downloader.py file in C:\

  • Place the Subtitle.cmd in sendto folder in windows (can be accessed by typing shell:sendto in address bar)

  • Right click the movie file (not the movie folder). You can also select multiple files. and click sendto -> Subtitle.cmd

  • If you want to download subtitles for all movies in a folder, you can use a folder as parameter to subtitle-downloader.py.

Mac:

  • Install python and make sure it is in your path

  • install click, requests, bs4 libraries

        pip install click requests bs4
    
  • Open Automator and create a new document of type "Service"

  • Add an action called "Run Shell Script"

  • On the top, under 'Service receives selected' drop-down, select 'files or folder' and in the next drop-down, for 'in' select 'Finder'

  • On the right top of the Run Shell Script action, make sure you selected "as arguments" for "Pass Input"

  • Copy the contents of subtitle.sh in the action

  • Edit the path to "subtitle-downloader.py" to wherever you have downloaded

  • Press Command + S to save it and give some name like "Download Subtitle"

  • Now, Right click the movie file (not the movie folder). You can also select multiple files. Click Services -> Download Subtitle

gif

Linux with Nautilus file manager(Tested on Debian Based with nautilus as file manager):
  • Install python

  • install click, requests, bs4 libraries

        pip install click requests bs4
    
  • Go to ~/.local/share/nautilus/scripts/ (Ubuntu 13.04 or above) OR ~/.gnome2/nautilus-scripts/ (Ubuntu 12.10 and below) folder and add Subtitles_in_english.sh in the folder.

  • The path for subtitle-downloader.py is hardcoded to Desktop ...U can change it accordingly.

  • Now Right Click on the movie file (not the movie folder). You can also select multiple files. Click Services -> Subtitles_in_english.

ScreenShot

Voila. the .srt subtitle file will be created right next to your movie file.

Enjoy the show!

More details can be found here : http://qr.ae/GxOcx A how to video can be found here: http://www.youtube.com/watch?v=Q5YWEqgw9X8

Linux with NEMO file manager(Tested on Debian Based with NEMO as file manager):
  • Install python

  • Go to ~/.gnome2/nemo-scripts folder and add Subtitles_In_English_for_nemo.sh in the folder.

  • The path for subtitle-downloader.py is hardcoded to Desktop ...You can change it accordingly.

  • Open terminal and execute following command :

chmod +x ~/.gnome2/nemo-scripts/Subtitles_In_English_for_nemo.sh
  • Now Right Click on the movie file (not the movie folder). You can also select multiple files. Click Services -> Subtitles_In_English_for_nemo.

Voila. the .srt subtitle file will be created right next to your movie file.

Development

We would love if you can contribute to make this project better. Here's how you can do it:

  1. Fork the project.
  2. Commit changes or bugfixes to your repo.
  3. Submit a pull request
  4. Sit back and relax while our maintainers checkout your changes and approve them!

subtitle-downloader's People

Contributors

0xmh avatar arunshivaram avatar avsrivas avatar beli4l avatar deadcoder0904 avatar ferbncode avatar harishoss avatar ivandrofly avatar johanmcquillan avatar mandar12 avatar manojmj92 avatar marauderlabs avatar mendes-jose avatar mohanraj-r avatar naveenippili avatar nilesh3105 avatar niroyb avatar pazran avatar rahilsharma avatar ramolaweb avatar rayhan737 avatar sjs7007 avatar sravi4701 avatar sunilthorat09 avatar syed-shah-zepto avatar thyrgle avatar tushalien avatar vishnu-priyan 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  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

subtitle-downloader's Issues

Add requirements.txt to install dependency required

Since the script require Request and Beautiful Soup library to run , It will be great to add requirements.txt file as it will help to install the dependency required to run the script and causes no error if the user have not the required library provided.

Script is broken

Hey there,

Looks like the script is broken - it keeps throwing 404.

python /Users/alagu/bin/Subtitle_Downloader.py /Users/alagu/Movies/Swades/Swades1.avi                   
Traceback (most recent call last):
  File "/Users/alagu/bin/Subtitle_Downloader.py", line 49, in <module>
    sub_downloader(path)
  File "/Users/alagu/bin/Subtitle_Downloader.py", line 44, in sub_downloader
    response = urllib2.urlopen(req).read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

Not working for many movies

I removed square braces in the path and tried still, a cmd window pops and and left. how to pause the cmd window and see the error message. I tried giving pause in the batch file but nothing works.

nemo-script on linux-mint (18.3, cinnamon) not working

I'm running on linux-mint 18.3 (cinnamon version) and tried to follow the instruction to get everything working for nemo.

Within ~/.gnome2/ there was no nemo-scripts directory, so I created the it and placed Subtitles_In_English_for_nemo.sh in there. I followed all other instructions as well.

When I right click on the movie, there is no option to click on Services

AttributeError("'builtin_function_or_method' object has no attribute 'namelist'",)

$ ~/apps/subtitle-downloader/subtitle-downloader.py Interstellar.2014.IMAX.1080p.Bluray.x264.DTS-EVO.mkv
Error in fetching subtitle for Interstellar.2014.IMAX.1080p.Bluray.x264.DTS-EVO.mkv
('Error', (<type 'exceptions.AttributeError'>, AttributeError("'builtin_function_or_method' object has no attribute 'namelist'",), <traceback object at 0x7fb7fcfd2cf8>))

Git clone on ubuntu 16.04 LTS

Windows permission error on C:\

First of all I would like to say its an amazing piece of script you've written. Bravo!

But I'd also like to point out when I put the subtitle-downloader.py in *C:* (according to the README) I was getting a IO Error due to the script not having permission to write the log file. So to resolve the issue I put the subtitle-downloader.py in a location where it doesn't need to have permission and then changed the Subtitle.cmd accordingly.

I think you might mention this in your README as windows by default doesn't give write permission on C:\ root.

adding more language

hi i wanted to use this open source program for my school's assignment project. by doing so, i need to add an enhancements to the program so i am asking may i add another language and add another suitable movie file format?

Tried to use it on Ubuntu 16.04

I tried to use this on Ubuntu 16.04 , gave me error on line 19 in subtitle-downloader.py file saying there is no module requests which you are trying to import. When I commented that line and tried script worked fine. Check this.
My python version is 2.7.11+

Thanks.

Getting BadZipFile Exception while downloading the subtitle

When I was downloading the subtitle of the Serial , I was getting the error as follow due to which I was not able to download the subtitle.
Error in fetching subtitle for /home/sahil/Movie/Breaking Bad/Season 2/Breaking.Bad.S02E02.BluRay.720p.x264.mkv
Error (<class 'zipfile.BadZipFile'>, BadZipFile('File is not a zip file',), <traceback object at 0x7f7bab887c48>)

Displaying HTTPError help needed

Hello, thanks for the code. I've found below error while executing script.

Error  (<class 'urllib.error.HTTPError'>, HTTPError(), <traceback object at  0x03092580>)

When I traced the hash file and entered url directly in browser, it displays a blank page.
here is the url,

http://api.thesubdb.com/?action=download&hash=93f5905927c3c95e135dfcfc8eef1d4d&language=en

I doubt whether there is not any subtitle file on website of this hash.
I request you if you've working file and it actually downloads the subtitle file then please share me the hash of the file so that I can check it in the script.

Thanks

cmd file and python script works - send to doesn't (windows 10)

Hi again.

Ok, so I got the script to work now. I followed the instructions putting the cmd file in the send to directory. Right clicking a movie and sending it to the cmd file just flashes a black windows (command prompt) really quickly with nothing happening. If I call the cmd directly it works like a charm. I've tried adding pause statements in the cmd to see where it breaks, but even if I put a pause on the first line nothing happens. I guess this means it doesn't even start to run the file.

Anyone got any ideas what might be happening?

Subtitles not downloading getting a lxml parsing error

ERROR:root:Error in fetching subtitle for D:\tv\Riverdale\Riverdale.S02E02.720p.HDTV.2CH.x265.HEVC-PSA.mkv(<class 'bs4.FeatureNotFound'>, FeatureNotFound("Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?",), <traceback object at 0x000001A8FA111D08>)

ModuleNotFoundError

Traceback (most recent call last):
File "C:\subtitle-downloader.py", line 19, in
import requests,time,re,zipfile
ModuleNotFoundError: No module named 'requests'
Traceback (most recent call last):
File "C:\subtitle-downloader.py", line 19, in
import requests,time,re,zipfile
ModuleNotFoundError: No module named 'requests'
Traceback (most recent call last):
File "C:\subtitle-downloader.py", line 19, in
import requests,time,re,zipfile
ModuleNotFoundError: No module named 'requests'
Traceback (most recent call last):
File "C:\subtitle-downloader.py", line 19, in
import requests,time,re,zipfile
ModuleNotFoundError: No module named 'requests'
GOTO was unexpected at this time.

Above error comes when I am using the script.

Update README.md

So I've followed the instructions of the README.md file and recognized that the script wouldn't work for me (Ubuntu 16.04). There were 2 Issues on my side:

  1. ~/.gnome2/nautilus-scripts is probably deprecated and hence no longer supported (?) -- see https://help.ubuntu.com/community/NautilusScriptsHowto
  2. I needed a XML Parser for Python which wasn't written down as a requirement.

To solve those Issues:

  1. place the scripts in here: ~/.local/share/nautilus/scripts/ and don't forget to make it executable
  2. type in: sudo apt install python2.7-lxml to download the XML-Parser

error in fetching subtitles

after i send the movie file or folder on my windows 8 system it shows error in fetching subtitles. Please see to it soon because i need it to be done till today evening or by tomorrow morning.

ImportError

Command prompt says:
No Module named 'request'

instructions aren't clear

If anyone follows the instructions specified in the readme.MD file it won't run because of installation-of-libraries (bs4, requests, click) didn't specify. @manojmj92 did you intentionally not specified it?

15 BOX OFFICE MOVIES 2023

#1. The Equalizer 3 (2023)
Robert McCall finds himself at home in Southern Italy but he discovers his friends are under the control of local crime bosses. As events turn deadly, McCall knows what he has to do: become his friends' protector by taking on the mafia.

Richard Lindheim
Characters

Michael Sloan
Characters

Antoine Fuqua
Director

Richard Wenk
Writer
#The Equalizer 3 (2023) MOVIES trailer

#The Equalizer 3 (2023) MOVIES Netflix Free Download

#The Equalizer 3 (2023) MOVIES Hulu Free Download

#The Equalizer 3 (2023) MOVIES Disney Plus Free Download

#The Equalizer 3 (2023) MOVIES Where to download free

#The Equalizer 3 (2023) MOVIES is available on NETFLIX, HULU, DISNEY, AMAZON PRIME
#2. Haunted Mansion (2023)
A woman and her son enlist a motley crew of so-called spiritual experts to help rid their home of supernatural squatters.

Justin Simien
Director

Katie Dippold
Writer
#Haunted Mansion (2023) MOVIES trailer

#Haunted Mansion (2023) MOVIES Netflix Free Download

#Haunted Mansion (2023) MOVIES Hulu Free Download

#Haunted Mansion (2023) MOVIES Disney Plus Free Download

#Haunted Mansion (2023) MOVIES Where to download free

#Haunted Mansion (2023) MOVIES is available on NETFLIX, HULU, DISNEY, AMAZON PRIME
#3. The Nun II (2023)
In 1956 France, a priest is violently murdered, and Sister Irene begins to investigate. She once again comes face-to-face with a powerful evil.

Akela Cooper
Screenplay, Story

James Wan
Characters

Gary Dauberman
Characters

Michael Chaves
Director

Richard Naing
Screenplay

Ian B. Goldberg
Screenplay
#The Nun II (2023) MOVIES trailer

#The Nun II (2023) MOVIES Netflix Free Download

#The Nun II (2023) MOVIES Hulu Free Download

#The Nun II (2023) MOVIES Disney Plus Free Download

#The Nun II (2023) MOVIES Where to download free

#Haunted Mansion (2023) MOVIES is available on NETFLIX, HULU, DISNEY, AMAZON PRIME

Action file for Dolphin/KDE5

I wanted to contribute with instructions on how to add the "Download Subtitle" item in the right-click context menu under Dolphin/KDE5

  1. Go in /home/<username>/.local/share/kservices5/ServiceMenus/
  2. Create the file DownloadSub.desktop
  3. Put the following content into the file. Substitute with the path to the repository
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin,video/*
Actions=DownSub

[Desktop Action DownSub]
Name=Download Subtitles
Icon=kfm
Exec=<path_to_repository>/subtitle-downloader.py "%U"
  1. Make the file executable
  2. Close all instances of Dolphin and reopen it
  3. Right click on a video file and go to the "Actions" sub-menu. You should find the item there

Commit aa37dd breaks script

Latest commit to include subscene breaks the script by use of BS4 and requests modules.

Either installation instructions should be added or script should handle the ImportError

Following lines are to help people coming here looking for help meanwhile:
c:\python27\scripts\easy_install-2.7.exe requests
c:\python27\scripts\easy_install-2.7.exe BeautifulSoup4

Not working for Mac

Hi

Trying to run it on a mac but I'm not able to.
I've added the script in "Services" but can't see it when I right click

Please resolve

Cannot install missing modules

Hi.
I was recommended this script, so went to try it. Installed python to my d: drive (windows 10), added python and python\scripts to my path, ran the script installed the requests module, tried again and it still failed. Went to install re, bs4 and zipfiles, but none of them will install.

`pip install -vvv zipfiles
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Config variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect
Collecting zipfiles
1 location(s) to search for versions of zipfiles:

  • https://pypi.python.org/simple/zipfiles/
    Getting page https://pypi.python.org/simple/zipfiles/
    Looking up "https://pypi.python.org/simple/zipfiles/" in the cache
    No cache entry available
    Starting new HTTPS connection (1): pypi.python.org
    https://pypi.python.org:443 "GET /simple/zipfiles/ HTTP/1.1" 404 37
    Status code 404 not in [200, 203, 300, 301]
    Could not fetch URL https://pypi.python.org/simple/zipfiles/: 404 Client Error: Not Found (zipfiles does not exist) for url: https://pypi.python.org/simple/zipfiles/ - skipping
    Could not find a version that satisfies the requirement zipfiles (from versions: )
    Cleaning up...
    No matching distribution found for zipfiles
    Exception information:
    Traceback (most recent call last):
    File "d:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
    File "d:\python27\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
    File "d:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
    File "d:\python27\lib\site-packages\pip\req\req_set.py", line 554, in _prepare_file
    require_hashes
    File "d:\python27\lib\site-packages\pip\req\req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
    File "d:\python27\lib\site-packages\pip\index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
    DistributionNotFound: No matching distribution found for zipfiles`

Same thing happens for all of them. Is there a way to manually download or fix this?

Cheers!

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.