openzim / youtube

Create a ZIM file from a Youtube channel/username/playlist
GNU General Public License v3.0
44 stars 26 forks source link

Fix subtitles display and prevent crash on Hebrew subtitles #113

Closed satyamtg closed 4 years ago

satyamtg commented 4 years ago

This fixes #112 and has some other subtitle related fixes as follows -

rgaudin commented 4 years ago

Pushed some modifications:

Let me know if this is OK

satyamtg commented 4 years ago

Pushed some modifications:

  • renamed the map variable as we never use words concatenated this way.
  • also added es-419. Both were taken care of back in the days and were dropped when we switched to scraperlib…
  • removed the mapping of the user specified language. We already expressed what we expect in entrypoint. There is no reason for user to specify a youtube-specific code there and should he do that, it will fail early.
  • removed the function altogether as this is just getting from a dict
  • revamped the subtitle name formatting code so it's clearer and adjusted to match Youtube.com

Let me know if this is OK

Yup. These actually seem to be better. I wonder why I didn't think of doing it with dict.get() instead of a function.