Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Subtitles #55

Closed
rrooij opened this issue Oct 19, 2015 · 33 comments
Closed

[Feature request] Subtitles #55

rrooij opened this issue Oct 19, 2015 · 33 comments
Labels
feature request Issue is related to a feature in the app help wanted Help is wanted in fixing this issue

Comments

@rrooij
Copy link
Contributor

rrooij commented Oct 19, 2015

Subtitles are currently not supported. It would be nice to have this feature.

@theScrabi
Copy link
Member

I'll keep it in mind.

@theScrabi theScrabi added the feature request Issue is related to a feature in the app label Oct 25, 2015
@theScrabi
Copy link
Member

Hm could someone figure out how to extract subtitles? And how to read those?

@rrooij
Copy link
Contributor Author

rrooij commented Nov 8, 2015

@theScrabi
youtube-dl is able to extract the subtitles, maybe it is worth looking at their source code.

As for reading them, I don't know. They are SRT-formatted, they use another file extension, but it is basically the same how Youtube uses it.

@theScrabi
Copy link
Member

Not yet.

@theScrabi
Copy link
Member

Still no. This may take a while untilIi finaly find time to care about that. Still there are hundred other things to do first.

@KOLANICH
Copy link

KOLANICH commented Dec 3, 2015

Here is the implementation http://google2srt.sourceforge.net/en/

@theScrabi
Copy link
Member

Good thanks :)

@ZatsuneNoMokou
Copy link

Any change?

@theScrabi
Copy link
Member

Yep exoplayer actually supports subtitles, so at least its possible to implement something like that. But unless we get proper exoplayer support, it's no worth speaking about it. So far exoplayer support is still an experimental early bird.

@theScrabi
Copy link
Member

I wished NewPipe development would go faster :/

@rrooij
Copy link
Contributor Author

rrooij commented Mar 8, 2016

@theScrabi What about adding the label help needed to this issue or add a TODO list with things that need to be done (e.g. a TODO.md)? That way, volunteers can quickly get an overview of what needs to get done. There's an overview in README.md but it doesn't state what the status of those developments is.

@theScrabi theScrabi added the help wanted Help is wanted in fixing this issue label Mar 8, 2016
@theScrabi
Copy link
Member

That autosub thing is Python we cant integrate it into NewPipe.

Also guys if you want to have subtitles, and asome other advanced features, than help me make exoplayer possible :). One thing I'd really like to so see, and I think its not that hard, is a new UI for the new player. With version 0.7.7 I'll deliver an experimental support for exoplayer, than you will see how it looks. However the UI of the current player is kind of a mess, I don't like that ugly MediaInterface, and the hide/show UI thing never worked correctly. I'd really appreciate it if someone could try to help me a bit with that :)

@jeremy447
Copy link

That's a really useful feature. I hope it will be implemented soon :)

@theScrabi
Copy link
Member

Still I had to implement exoplayer in order to make this feature work, it's just gowing forward realy realy slow :/

@veechiecooqu
Copy link

I will just +1 it because that's the best I can do :D

@theScrabi
Copy link
Member

Yea this should come :)

@antoninkriz
Copy link

Ive checkes how 'youtube-dl' gets its subtitles, it's actually pretty simple method, even without understanding python, I am sure it's pretty easy to implement, since its just loading two files and parsing them.

Python code from youtube-dl:

 def _get_subtitles(self, video_id, webpage):
        try:
            subs_doc = self._download_xml(
                'https://video.google.com/timedtext?hl=en&type=list&v=%s' % video_id,
                video_id, note=False)
        except ExtractorError as err:
            self._downloader.report_warning('unable to download video subtitles: %s' % error_to_compat_str(err))
            return {}

        sub_lang_list = {}
        for track in subs_doc.findall('track'):
            lang = track.attrib['lang_code']
            if lang in sub_lang_list:
                continue
            sub_formats = []
            for ext in self._SUBTITLE_FORMATS:
                params = compat_urllib_parse_urlencode({
                    'lang': lang,
                    'v': video_id,
                    'fmt': ext,
                    'name': track.attrib['name'].encode('utf-8'),
                })
                sub_formats.append({
                    'url': 'https://www.youtube.com/api/timedtext?' + params,
                    'ext': ext,
                })
            sub_lang_list[lang] = sub_formats
        if not sub_lang_list:
            self._downloader.report_warning('video doesn\'t have subtitles')
            return {}
return sub_lang_list

@ghost
Copy link

ghost commented Nov 21, 2017

@tonakriz: Could you implement it yourself and submit a PR to NewPipeExtractor?

@antoninkriz antoninkriz mentioned this issue Nov 21, 2017
2 tasks
@antoninkriz
Copy link

@wb9688 I can try to

@antoninkriz
Copy link

NewPipeExtractor supports subtitles from this moment. Would be great if someone could implement it to NewPipe.

@oxwivi
Copy link

oxwivi commented Jan 3, 2018

This is one of my pain points for me as a regular viewer of TED talks. I can do a but of Java, so if you've any leads, do tell if there's anyhow I can help.

@theScrabi
Copy link
Member

Well someone had to pull the subtitles out of the extractor, and put them into ExoPlayer.

@oxwivi
Copy link

oxwivi commented Jan 3, 2018 via email

@theScrabi
Copy link
Member

ExoPlayer is the player framework we use to display the video.

@KOLANICH
Copy link

KOLANICH commented Jan 3, 2018

How about using subtitles and audio with external players like VLC?

@antoninkriz
Copy link

Here is some help you might need. I am sorry for not working on this issue anymore, but I have a lot of work to do.

@moshpirit
Copy link

Not a developer but I found that SimpleExoPlayer has SubtitleView but I'm not sure if this is relevant enough since it's a 2016 Nov post. This said, there's still a lot of issues related to the subs

@theScrabi
Copy link
Member

We have exoplayer support this all isn't a big problem anymore. Just someone had to link things together :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app help wanted Help is wanted in fixing this issue
Projects
None yet
Development

No branches or pull requests

10 participants