2

There is a media player for Windows, BSPlayer, which can automatically download subtitles.

The great thing about it is that it kind of magically always picks the right one, contrary to manual downloading where one can end up with subtitles that are not synchronized correctly. I don't know how it does it and which information in the movie file it uses. It definitely checks multiple subtitle websites.

Is there anything in the Linux world to emulate this functionality?

2

VLC come with a (build-in?) plugin called VLsub which allow you to search a substitle based on it HASH or just its name. (It was integrated in VLC 2.2 but it needs updated from time to time from here.)

To install it, the needed folder is ~/.local/share/vlc/lua/extensions/ for the current user and /usr/lib/vlc/lua/extensions/ for all users.

  • The Search by Hash option is much accurate, but it require to hash the video file, which can be hard when/if you steam the file over the network.
  • The Search by Name option is much faster, but less accurate.

VLC VLsub Window

  • That plugin wasn't builtin until (around) version 2.0.6. Before that, you would have to install it manually. To access the plugin, you have to go to "View" > "Dowload subtitles". The "Search by hash" option is quite fast (somehow, VLC calculates hashes pretty quickly), but almost always doesn't find results. I've noticed it works better with files from PopcornTime. – Ismael Miguel Dec 19 '16 at 2:48
  • This is really the most powerful tool in Linux lately, and it comes by default with VLC 2.2, but it needs to be updated from here: addons.videolan.org/content/show.php/VLSub+0.8?content=148752 – user32012 Jan 19 '17 at 20:18
1

I will adjust my answer under this question for the needs of your question.

There are two kind of subtitle-search:

  • HASH search: exact match, fewer hits; chances to find subtitles are smaller (50% or lower in my experience), but chances for the found subtitles to be good are very high (possibly 100%)

  • name search: greater chances to find some subtitles for a video (90% maybe), less chances that all found are good, but excellent chances that one of them is good.

But the applications themselves either use HASH-only search or HASH & name search. As the latter first try the exact HASH search and then do the name search, I would favor the latter.

But there are other differences between these tools, namely weather subtitles are automatically downloaded (without any intervention from your part) or just listed. Note that a fully automated download is ideal only when you only need subtitle for only one language and when the hash search succeeds. Having to chose in a list may be an advantage when the search and the finding is only by name.


From your own answer I see you have settled for subliminal, which is far from what you ask in the question (a tool that acts closely to what BSPlayer does), so I will first suggest some solutions that are less similar to BSPlayer, and are more similar to subliminal.

There are some comfortable solutions for adding subtitle search (both by HASH and name) to the context menu of the file manager. The first is a command line program that works very similarly to subliminal, the second is a script.

FileBot command-line version

is very powerful, but maybe somewhat cumbersome to put in place, as it comes with as a large GUI program and it also needs java (which is also large).

The general command is filebot -get-subtitles /path/to/video/.

To search also by name (beside hash) the -non-strict option should be used.

To download English subtitles no language option is needed, but for other languages there is the option --lang with the 2 or 3 letter language code, but only one language can be specified per command, so you have to use separate commands for each language.

To rename the media files (using TMDb) and match their names, a useful option is -rename.

The command can be added to context menu in Thunar's custom actions (or Nautilus actions, etc) by running it in a terminal; for French it should be:

gnome-terminal -e "filebot -get-subtitles  --lang fr -rename -non-strict %f"

enter image description here

enter image description here

I especially like about it the ability to download subtitles for multiple videos at once; for that you have to put those in a folder, select the folder and then the context-menu option (for that you need to add the directory to the conditions of the action in Thunar or Nautilus config tool), and it will download subs for all included videos. - In this way (if the -rename option is included) it is able at the same time to correct and match the name of multiple videos and files.

You do not need and cannot select between subtitles, but it is somehow able to select the best subtitles even when they have been found after a name search.


OpenSubtitlesDownload.py

OpenSubtitlesDownload.py is another file-manager context-menu tool that search by hash and name.

"It can be used as a nautilus script, or as a regular application working under GNOME or KDE desktop environments."

For Nautilus:

git clone https://github.com/emericg/OpenSubtitlesDownload.git
mkdir -p ~/.local/share/nautilus/scripts/
cp OpenSubtitlesDownload/OpenSubtitlesDownload.py ~/.local/share/nautilus/scripts/OpenSubtitlesDownload.py
chmod u+x ~/.local/share/nautilus/scripts/OpenSubtitlesDownload.py

enter image description here

enter image description here

But the OpenSubtitlesDownload.py script can be used in other File managers (Thunar custom actions, Nemo actions, Pantheon-Files contract files) by adding the command

sh -c "/path/to/OpenSubtitlesDownload.py %f"

The only downside I've noticed is that it seems to be less effective in finding subtitles for series than for feature movies.


If what you want is something exactly similar to BSPlayer (and MPC-HC for that matter) in Windows:

SMPlayer

has that very option, as indicated here.

enter image description here

SMPlayer checks hash-only by default, by which you may get fewer hits than with other tools, but this can be changed in settings (Subtitles-Find subtitles at...-Options):

enter image description here

VLC

Already mentioned in another answer. You mention a bug in your answer; but even if that is not fixed (I doubt that) the downloading subtitles tool (VLSub) is not affected. You can start a movie in VLC,download subs, and then play in mpv. Only you have to keep VLSub up-to-date.

VLC searches both by hash and name; it lets you chose the subtitle, but the latest tested replaces automatically the previous one.


SubDownloader and FileBot GUI version are programs that run separately from any player and from the file manager. They are useful I think especially when searching subtitles for multiple videos (although I use FileBot CLI version as above for that) and also a way to display them before downloading them all. I find this type of applications a bit cumbersome compared to the previous ones. SubDownload searches only by HASH.

  • Thanks for this detailed answer, +1! I still keep my own answer marked as accepted, because it solves the issue for me. Using subliminal works fine for me, it has yet to disappoint me. And I already wrote a script using it which cares for the whole megillah like unraring, downloading subitles, firing up mplayer etc. – wolf-revo-cats Feb 9 '17 at 0:27
  • @wolf-revo-cats - Why not post the script in your answer? - In fact I use subliminal too in the same way I use filebot. – user32012 Feb 9 '17 at 9:03
0
--write-sub                      Write subtitle file
--write-auto-sub                 Write automatic subtitle file (YouTube only)
--all-subs                       Download all the available subtitles of the video
--list-subs                      List all available subtitles for the video
--sub-format FORMAT              Subtitle format, accepts formats preference, for example: "srt" or "ass/srt/best"
--sub-lang LANGS                 Languages of the subtitles to download (optional) separated by commas, use IETF language tags like 'en,pt'

So for example, to list all subs for a video:

youtube-dl --list-subs [link video]

To download all subs, but not the video:

youtube-dl --all-subs --skip-download [link video]

link to read all

  • this answer really misses the point. This is about subtitles for videos I already have on my hard drive. – wolf-revo-cats Jan 7 '17 at 17:44
0

Rabin's suggestion is nice, I somehow missed that VLC had this functionality. Sadly, I have serious problems with VLC, because of this bug.

I found a solution that is independent from the player you use (I use mplayer).

Admittedly, I don't even use Linux but FreeBSD. ;-)

Here is how I did it:

Install Python 3:

pkg install python3

You'll need pip, it comes with python 3.4+, for an earlier version see here.

In FreeBSD (I think this can be skipped for Linux??) you must also do:

python3.4 -m ensurepip

Then you install the python program subliminal. As root, execute

pip install subliminal

To automatically download English subtitles, you would do:

subliminal download -l en The.Big.Bang.Theory.S05E18.HDTV.x264-LOL.mp4

where -l is the language option.

  • You can use VLC to download subtitles without necessarily having to watch the video with that player. VLSub stands as one of the best tools in terms of ability of finding subs both by hash (almost certainly good subs, if any) and by name (some chance of error but lot more hits). I will provide a new answer. – user32012 Feb 6 '17 at 14:21
  • subliminal can be added to context menu in a file manager like Thunar (custom actions): terminator -e "subliminal download -l en %f", and that can be applied to folders too, in order to download subs for all videos there – user32012 Feb 6 '17 at 16:27
0

You can do exactly the same this using this open source project https://github.com/atulgpt/SubtitleDownloader.git It also supports batch mode, recursive folder search and two different database. And for better results it uses hash of a video file. If found useful give a star to the project and up-vote this answer :)

  • Have you used this? Does it work well? – bu5hman Dec 3 '17 at 7:57
  • yes. I am using it and if you faces any problem then you can contact me. If found useful than star the repo and upvote the answer. In case of any bug you can contact the developer – Atul Gupta Dec 10 '17 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.