SMPlayer auto subtitles loading from certain directory

Problems, bugs, suggestions... anything related to SMPlayer.

SMPlayer auto subtitles loading from certain directory

Postby learnerOfEnglish » Fri Mar 17, 2017 10:33 pm

What should I do in order to force SMPlayer to load at once subtitles from certain directory? I download subtitles via youtube-dl in certain directory(in my case /tmp/subs), then I run SMPlayer with corresponding URL(actually I use mini script that gets URL, but its not the case), and I want SMPlayer to seek to that directory and load them(it would be great if it did it in order consistent with Preferences -> General -> Preferred language -> Subtitles. For example, if there is eng|ru, I would like to have eng subtitle on Primary Track and ru subtitle on Secondary Track)
Every time I run SMPlayer with URL, I have to do Subtitles->Load->[get to directory with subs and click required sub] twice and then once again choose(check) subtitle in Secondary Track option - it's very boring, especially when you want just to watch 5 min video

I was trying to handle it whole day, tried feed SMPlayer with more then one sub(via -sub key, though I read man and know that it takes filename only for one subtitles file :) ), tried to put keys --sub-paths=/tmp/subs --sub-auto=all|fuzzy at Preferences->Advanced->MPlayer/mpv Options, even tried to put there --ytdl --ytdl-raw-options=write-sub= --ytdl-raw-options=sub-lang=en - all without success.
learnerOfEnglish
 
Posts: 4
Joined: Fri Mar 17, 2017 5:46 pm

Re: SMPlayer auto subtitles loading from certain directory

Postby rvm » Sat Mar 18, 2017 2:47 am

If you use mpv as multimedia engine, adding something like --sub-paths=/tmp in preferences -> advanced -> mplayer/mpv -> options should work. You may also need to select the option "all subs in directory" in preferences -> subtitles -> autoload.
I've just tested it and it works.
rvm
Site Admin
 
Posts: 2690
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: SMPlayer auto subtitles loading from certain directory

Postby learnerOfEnglish » Sat Mar 18, 2017 7:47 am

rvm wrote:I've just tested it and it works.


Did you tested it with video you never earlier watched?
On my machine SMPlayer(17.3.0.8467) automatically downloads only one subtitles file, if I watched video and manually set subs earlier, and neither with new videos.

I set options exactly as you said and this is a script I use
Code: Select all
SUBS_DIR=/tmp/subs
if [ "$(ls -A $SUBS_DIR)" ]; then
    rm $SUBS_DIR/*
fi

youtube-dl --skip-download --write-sub --sub-lang="en,ru" $1 -o "$SUBS_DIR/%(title)s-%(id)s.%(ext)s"

smplayer  "${@:1}"
learnerOfEnglish
 
Posts: 4
Joined: Fri Mar 17, 2017 5:46 pm

Re: SMPlayer auto subtitles loading from certain directory

Postby rvm » Sat Mar 18, 2017 10:22 pm

Yes, it works for me with videos never watched before.

By the way, if you select "mpv + youtube-dl" in preferences -> network -> support for video sites, then the youtube subtitles are available in smplayer, no need to download them.
rvm
Site Admin
 
Posts: 2690
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: SMPlayer auto subtitles loading from certain directory

Postby learnerOfEnglish » Sun Mar 19, 2017 12:15 am

Great! It's what I was looking for :)

Downside:
It loads a bunch of subtitles that I don't need at all(for example, popular ted talks videos have about 30-60 subs).
Can I somehow pass to youtube-dl in "mpv + youtube-dl" the --sub-lang key?
learnerOfEnglish
 
Posts: 4
Joined: Fri Mar 17, 2017 5:46 pm

Re: SMPlayer auto subtitles loading from certain directory

Postby rvm » Sun Mar 19, 2017 2:47 am

It's possible to pass options to youtube-dl using the mpv option --ytdl-raw-options (https://mpv.io/manual/stable/#options-ytdl-raw-options)

However I wasn't able to use the option --sub-lang successfully with it.
rvm
Site Admin
 
Posts: 2690
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: SMPlayer auto subtitles loading from certain directory

Postby learnerOfEnglish » Sun Mar 19, 2017 8:06 am

Thank you for help:), I am quite satisfied with mpv+youtube-dl option(though it's not as fast as using bare mpv without youtube-dl and loads all subs).
learnerOfEnglish
 
Posts: 4
Joined: Fri Mar 17, 2017 5:46 pm


Return to General

Who is online

Users browsing this forum: Google [Bot] and 2 guests