allejok96 / jw-scripts

Index or download videos and sound recordings from jw.org.
GNU General Public License v3.0
50 stars 10 forks source link

Match subtitle names and add language code to filename #38

Open gamemaster84 opened 3 years ago

gamemaster84 commented 3 years ago

This is not a bug but just a suggestion, if possible offcourse.

I would love to have the ability to download the videos in language A and have the subs in language B. But when did it manually with the given commands i endup with different names (same videos but in 2 languages) and plex doesn't see the subs because the filename is not the same. It would be need to download the subs with the same names as language A (video language) but have the subs in language B. (prefabably with the language code in the name).

Thanks for you're hard work!!

allejok96 commented 3 years ago

Ok so there is a few things I need to know to make this as smooth as possible:

Are you using --mode=filesystem or --friendly ? If I understand correctly, only using --download and --download-subtitles won't work currently because the subtitles will not match the name of the video (video has resolution appended in the name).

The best would IMO be to implement this in --mode=filesystem and do the name change "virtually" using links, but I don't know if that's the best setup for everyone...

Next, it would be even better to have a ISO language code in the subtitle filename, like you said.

https://support.plex.tv/articles/200471133-adding-local-subtitles-to-your-media/

I see there is a way to mark subtitles as forced. Is that necessary to make Plex select the external subtitle instead of subtitles embedded in the video? (Idk if all videos even have embedded subs). Or would it be enough to have the subtitle file with the correct language code and Plex would autoselect it since it's your preferred language? (I know I'm asking a lot of question right now :)

gamemaster84 commented 3 years ago

Hi,

I use the --friendly command. I only Download 1 category and have a cron job to check each hour.

If there's a extra subtitle, with the same name, plex will see that and give it as an option instead of the embedded one. I can test this out this week with the subs I donwloaded. I'll give them the same name with the language in it andet you know if that works.

Op ma 21 jun. 2021 20:54 schreef Alex @.***>:

Ok so there is a few things I need to know to make this as smooth as possible:

Are you using --mode=filesystem or --friendly ? If I understand correctly, only using --download and --download-subtitles won't work currently because the subtitles will not match the name of the video (video has resolution appended in the name).

The best would IMO be to implement this in --mode=filesystem and do the name change "virtually" using links, but I don't know if that's the best setup for everyone...

Next, it would be even better to have a ISO language code in the subtitle filename, like you said.

https://support.plex.tv/articles/200471133-adding-local-subtitles-to-your-media/

I see there is a way to mark subtitles as forced. Is that necessary to make Plex select the external subtitle instead of subtitles embedded in the video? (Idk if all videos even have embedded subs). Or would it be enough to have the subtitle file with the correct language code and Plex would autoselect it since it's your preferred language? (I know I'm asking a lot of question right now :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/allejok96/jw-scripts/issues/38#issuecomment-865267000, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCDC266L4XNFQ3XFTSEKSDTT6DGNANCNFSM467CM6MA .

allejok96 commented 3 years ago

Could you also please test if --mode=filesystem works for your usecase?

gamemaster84 commented 3 years ago

Test 1 add subtitle with the same name and the language code.

This worked. I manually renamed the vtt file to the video name with the language code and plex grabbed it as a subtitle.

Test 2 using filesystem I used filesystem to grab the --latest category and then did the update command. It created all the folders but didn't rename anything. So now in plex it shows filenames and not the "friendly" names.

Op di 22 jun. 2021 19:17 schreef Alex @.***>:

Could you also please test if --mode=filesystem works for your usecase?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/allejok96/jw-scripts/issues/38#issuecomment-866177577, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCDC25QX4VOO3RMNCHW223TUDAR7ANCNFSM467CM6MA .

allejok96 commented 3 years ago

Thank you for your valuable feedback. I've uploaded some new code. Multi language subtitles should be working. Also --mode=filesystem. What are you running your plex server on? I'm testing a plex server on win right now and it doesn't work properly with mode=filesystem. I'll be looking into that more. Please test it if you can... (In plex you choose "Folders" instead of "Movies" and it should be like browsing broadcasting in JW library)

And by the way if you'd use Kodi instead there is a JW Broadcasting addon with this different-subtitle-language-feature already in place and it requires no video downloading, it streams everything directly. Works like a charm. (How shameless I am)

gamemaster84 commented 3 years ago

That's great thanks, il test it out. I run plex on a Linux server. And have the plex app on my TV. That's why I don't use kodi. I don't have a mediaplayer on the TV. What commands do I use for multilanguage subs?

Op zo 27 jun. 2021 22:50 schreef Alex @.***>:

Thank you for your valuable feedback. I've uploaded some new code. Multi language subtitles should be working. Also --mode=filesystem. What are you running your plex server on? I'm testing a plex server on win right now and it doesn't work properly with mode=filesystem. I'll be looking into that more. Please test it if you can... (In plex you choose "Folders" instead of "Movies" and it should be like browsing broadcasting in JW library)

And by the way if you'd use Kodi instead there is a JW Broadcasting addon with this different-subtitle-language-feature already in place and it requires no video downloading, it streams everything directly. Works like a charm. (How shameless I am)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/allejok96/jw-scripts/issues/38#issuecomment-869221910, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCDC244E2B4EN6BNYXI7ZLTU6FIVANCNFSM467CM6MA .

allejok96 commented 3 years ago

I just moved everything into a beta branch, since I haven't made up my mind completely. (I shouldn't do software development!) https://github.com/allejok96/jw-scripts/tree/v2.0-beta

Simple download:

jwb-index -l LANG -s LANG2,LANG3 -d --latest

Filesystem (preparation):

jwb-index -l LANG -m filesystem [--media-dir PATH]

Without --media-dir it defaults to jwb-data/media (this is what I haven't made up my mind about)

Filesystem (update):

jwb-index -l LANG -s LANG2,LANG3 -m filesystem [--media-dir PATH] -d --update

--update is like --latest but it puts things in the correct places.

How do you find the user experience otherwise? When I first developed this script I just wanted a playlist for Kodi. Then someone asked for downloading. And then for friendly names. And then Windows support. And suddenly 95% of people using this script are Plex users and I've never even used Plex myself. I'm not even using this script that frequently. So the options and the logic have become a bit messy.

I appreciate any feedback. What I'm thinking about most now is where to put media etc and how to the options for that should look like.

gamemaster84 commented 3 years ago

That’s great, I’ll test it out!

I’ve been using this script for some years now and love it. My older “smart” tv does work but somehow jw.org doesn’t work on it. But plex does. And I already had a plex server running so this script makes sense.

The only thing I had some trouble with was setting up a cron job. I’m not a real expert in Linux servers. But a brother helped me set it up and it has been working for years. Now we can watch the broadcast on tv yeay.

I’ll update you when i tested the subs.

Op 28 jun. 2021 om 17:41 heeft Alex @.***> het volgende geschreven:

 I just moved everything into a beta branch, since I haven't made up my mind completely. (I shouldn't do software development!) https://github.com/allejok96/jw-scripts/tree/v2.0-beta

Simple download:

jwb-index -l LANG -s LANG2,LANG3 -d --latest Filesystem (preparation):

jwb-index -l LANG -m filesystem [--media-dir PATH] Without --media-dir it defaults to jwb-data/media (this is what I haven't made up my mind about)

Filesystem (update):

jwb-index -l LANG -s LANG2,LANG3 -m filesystem [--media-dir PATH] -d --update --update is like --latest but it puts things in the correct places.

How do you find the user experience otherwise? When I first developed this script I just wanted a playlist for Kodi. Then someone asked for downloading. And then for friendly names. And then Windows support. And suddenly 95% of people using this script are Plex users and I've never even used Plex myself. I'm not even using this script that frequently. So the options and the logic have become a bit messy.

I appreciate any feedback. What I'm thinking about most now is where to put media etc and how to the options for that should look like.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

gamemaster84 commented 3 years ago

It’s working. The only thing is that plex doesn’t see the links made in the categories. When I selected the root folder with the files it sees the subs and video’s. But then plex doesn’t know the titles.

Op 28 jun. 2021 om 17:41 heeft Alex @.***> het volgende geschreven:

 I just moved everything into a beta branch, since I haven't made up my mind completely. (I shouldn't do software development!) https://github.com/allejok96/jw-scripts/tree/v2.0-beta

Simple download:

jwb-index -l LANG -s LANG2,LANG3 -d --latest Filesystem (preparation):

jwb-index -l LANG -m filesystem [--media-dir PATH] Without --media-dir it defaults to jwb-data/media (this is what I haven't made up my mind about)

Filesystem (update):

jwb-index -l LANG -s LANG2,LANG3 -m filesystem [--media-dir PATH] -d --update --update is like --latest but it puts things in the correct places.

How do you find the user experience otherwise? When I first developed this script I just wanted a playlist for Kodi. Then someone asked for downloading. And then for friendly names. And then Windows support. And suddenly 95% of people using this script are Plex users and I've never even used Plex myself. I'm not even using this script that frequently. So the options and the logic have become a bit messy.

I appreciate any feedback. What I'm thinking about most now is where to put media etc and how to the options for that should look like.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

allejok96 commented 3 years ago

Alright, thanks for the testing. So it's the same result as plex on windows. That's too bad. Strange though, the filesystem mode was written for plex explicitly (see #1). Wonder if it has changed with some update... It would be good to have it working. Plex's default sorting of JW videos gets kinda messy after a while, right? I have made some experiments with hard links instead of symbolic links and that might be more comaptible solution.

Well, this issue is mostly fixed, but until I decide to merge the beta code into master I will keep it open, for reference.

gamemaster84 commented 1 year ago

Is the multiple sub language merged with the stable branch?

I had to reinstall my server sigh.. I also looked at the kodi plugin but i can't find the multiple subtitle language. If i choose dutch, audio is also dutch.

allejok96 commented 1 year ago

No, it's not merged I'm afraid.

As far as the Kodi add-on the feature exists in an obscure way:

  1. In settings: choose your subtitle language as your language
  2. Also select "Always use last selected language"
  3. Go to any video, bring up the context menu and select "Play in another language"
  4. Select preferred audio language
  5. Now it will play with different audio/subs every time

... I'm currently working on making this more obvious

gamemaster84 commented 1 year ago

Great, I got it working on kodi!

Op di 14 feb. 2023 19:56 schreef Alex @.***>:

No, it's not merged I'm afraid.

As far as the Kodi add-on the feature exists in an obscure way:

  1. In settings: choose your subtitle language as your language
  2. Also select "Always use last selected language"
  3. Go to any video, bring up the context menu and select "Play in another language"
  4. Select preferred audio language
  5. Now it will play with different audio/subs every time

... I'm currently working on making this more obvious

— Reply to this email directly, view it on GitHub https://github.com/allejok96/jw-scripts/issues/38#issuecomment-1430230537, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCDC242QC4WQKMHBAHKJ4TWXPIPJANCNFSM467CM6MA . You are receiving this because you authored the thread.Message ID: @.***>