SmartTube icon indicating copy to clipboard operation
SmartTube copied to clipboard

subtitle...automatically translate

Open aouamed opened this issue 1 year ago • 10 comments

can we have the option automatically translate subtitle...Like youtube desktop ! thank you for all

aouamed avatar Aug 03 '22 19:08 aouamed

I will try to implement this myself and make a PR once I finish

PeterNjeim avatar Aug 10 '22 16:08 PeterNjeim

also someone asked the same thing just 12 hours before you: https://github.com/yuliskov/SmartTubeNext/issues/1741

PeterNjeim avatar Aug 10 '22 16:08 PeterNjeim

I got it working now, just need to improve the UI a little then I'll make a PR, probably tomorrow. However the code is slightly ugly due to the rigid coding that was done in relation to the subtitle downloading procedure, so I had to make my own classes and everything. Since there's no documentation for the code, I spent a good 5 hours just figuring out how the program even worked lol. Now I feel comfortable coding in this repository, and plan on adding/fixing quite a few more things.

Also I'm having trouble getting it to work on restricted videos, however there is already a workaround available, I'll probably ask yuliskov to implement it.

PeterNjeim avatar Aug 11 '22 23:08 PeterNjeim

Hey, thanks for implementing this; I really missed auto-translate when viewing Austrian Army analyses of the Ukraine War in German.

While on the topic, may I ask you to consider #1353 as well?

y-lee avatar Aug 12 '22 05:08 y-lee

I could, however I have lots of other fixes and features I am planning on working on, so it would be a while from now if/when I do it. Plus I don't know the code very well, as I stated earlier, so I'm not even sure where to start, would need to do more research on how the settings persist

PeterNjeim avatar Aug 12 '22 08:08 PeterNjeim

I spent a good 5 hours just figuring out how the program even worked lol.

this^ I'm trying to implement a channel whitelist for sponsorblock (mentioned in #1388 and #1671), as there are literally no comments in the code it's pretty hard to follow what's going on xD

Pr0mises avatar Sep 08 '22 17:09 Pr0mises

I actually stopped working on this feature a few weeks ago lol, was busy doing other things. I'll start working on it again today and hopefully finish it up

PeterNjeim avatar Sep 08 '22 17:09 PeterNjeim

Oh good to know, I'll stop working on it then. If you need any help don't mind hitting me up

Pr0mises avatar Sep 08 '22 17:09 Pr0mises

I'm talking about the feature of this issue, the auto-translate feature. Were you working on that too? Or just the SponsorBlock whitelisting. The reason I said something directly after you was because I got notified and remembered that I stopped working on this auto-translate feature

PeterNjeim avatar Sep 08 '22 17:09 PeterNjeim

Ah I see, I'm working on the SponsorBlock whitelisting

Pr0mises avatar Sep 08 '22 17:09 Pr0mises

Yuliskov implemented auto translate in the latest update

PeterNjeim avatar Oct 29 '22 18:10 PeterNjeim

The new auto translate is available. However it must be selected over and over again for each video. If we could have it in the setting to select it at all times upon enabling, it would be swell.

hypo-thesis avatar Oct 31 '22 22:10 hypo-thesis

That was one of the features I was working on, but Yuliskov ended up using a different, simpler approach to enable subtitles. You'd have to ask him if keeping it enabled is possible with the new approach

cc @yuliskov

PeterNjeim avatar Oct 31 '22 22:10 PeterNjeim

@hypo-thesis what you're saying sounds like a bug. Could you give me next info?

  1. STN (or system) language/country names
  2. Videos with subs to test

yuliskov avatar Oct 31 '22 22:10 yuliskov

@hypo-thesis what you're saying sounds like a bug. Could you give me next info?

  1. STN (or system) language/country names
  2. Videos with subs to test

It is not a bug or anything. Let me give you an example. When I go to a video without CC and long press Ok button on CC a menu pops up on the right which I can select auto translating language. For this I have to select the language everytime for the video I am watching. I wanted a feature in the setting that I could preselect the autotranslate language so that everytime the CC is on, it automatically translates from it instead of me clicking on my language everytime. This happens only with videos that don't have subs already and require Youtube to autotranslate to English or other languages. I hope I have explained myself clearly. If not, let me know to upload a gif video of it here.

Cheers for your efforts mate anyway.

hypo-thesis avatar Nov 01 '22 09:11 hypo-thesis

@hypo-thesis select subtitle language once and it will be auto-selected for any video.

yuliskov avatar Nov 01 '22 09:11 yuliskov

@hypo-thesis select subtitle language once and it will be auto-selected for any video.

For videos that are already subbed, this is true. Once you select it is always selected. But for videos without sub that require autotranslation, this has to be selected every time. I will upload a video and demonstrate it today.

hypo-thesis avatar Nov 01 '22 12:11 hypo-thesis

@hypo-thesis ok. But before that, update to 16.34. There are some fixes for subs.

yuliskov avatar Nov 01 '22 12:11 yuliskov

@hypo-thesis ok. But before that, update to 16.34. There are some fixes for subs.

Yep, it works as it should. Thanks for the efforts mate.

hypo-thesis avatar Nov 01 '22 12:11 hypo-thesis

@hypo-thesis great, thx for the help

yuliskov avatar Nov 01 '22 12:11 yuliskov

Apologies for commenting here, but wondering if I have the same issue or a new one. Every time I close SmartTube while partway through a video (or if the Shield goes into sleep mode), I have to re-select the correct subtitles.

The videos are in English, and I am selecting the English subtitles which were uploaded for the videos. The player is automatically switching to the English auto-generated subtitles instead of the ones uploaded. This happens on 16.37 and 16.54.

The player is also automatically preferring auto-generated english subtitles to any uploaded English subs, on any new video I watch.

I'm not sure if this is a bug, a feature, or working as designed. Happy to provide more info if needed.

preacher65 avatar Dec 19 '22 23:12 preacher65

I'm not facing your issue, try clearing the data of the app and try it again

PeterNjeim avatar Dec 19 '22 23:12 PeterNjeim

Yep, that seems to have fixed it. Thanks for such a speedy reply, and apologies for not already having tried something so basic. It's like I'd forgotten this was even Android I'm using.

preacher65 avatar Dec 19 '22 23:12 preacher65

A few videos later and I noticed that it has switched to auto-generated English subtitles by default again, instead of the previously selected uploaded English subs, when exiting a video part way through and resuming it. Have tried on several different videos, from different channels.

I have "always show captions" turned on in the desktop web app settings, and have just disabled "include auto-generated captions" there in case it makes any difference. Just posting here in case it is significant, I notice a number of caption related posts, but happy to post a proper "steps to reproduce" if required.

Will clear data again and try see at what point it stops remembering previously selected captions, as I'm sure it worked for a while after clearing data. Possibly some non-default setting I'm enabling after clearing data is impacting this?

preacher65 avatar Dec 21 '22 00:12 preacher65