spaam / svtplay-dl

Small command-line program to download videos from some streaming sites.
https://svtplay-dl.se
MIT License
713 stars 118 forks source link

whatlanguage service seems to be down. #1515

Open spaam opened 1 year ago

spaam commented 1 year ago

got some reports on discord that we are setting subtitles to und. it seems to be because the service we used is down.

how to handle this thing. add option do decide what language it is? if so, how to handle videos with several different languages like we have on urplay? force everything to one language? we dont really have an order when each file show up. english might come before swedish or swedish before english maybe we should just hardcode everything to und? 🤔

pythonuser3856 commented 1 year ago

Using svtplay-dl v4.17 and Python 3.8.1 I tried a couple of links at URplay.se and did get language-tagged .srt-files. Am I missing something ?

Using the command "svtplay-dl -S --all-subtitles": Link https://urplay.se/serie/220642-schnack SRT-files retrieved schnack.s01e01.wohnen-220647-urplay.ger.srt schnack.s01e01.wohnen-220647-urplay.swe.srt Link https://urplay.se/serie/213853-my-english-mistakes SRT-files retrieved my.english.mistakes.s01e01.when.i.tried.to.be.funny-213846-urplay.swe.srt my.english.mistakes.s01e01.when.i.tried.to.be.funny-213846-urplay.swe-partial.srt my.english.mistakes.s01e01.when.i.tried.to.be.funny-213846-urplay.eng.srt

spaam commented 1 year ago

this only happen when you use -M to merge the subtitles to the file. the metadata on the file say und now for the subtitle language. when running svtplay it will also show an error message.

INFO: Merge audio, video and subtitle into my.english.mistakes.s01e01.when.i.tried.to.be.funny-213846-urplay.mp4
INFO: Determining the language of the subtitle(s).
ERROR: Server error appeared. Setting language as undetermined.
ERROR: Server error appeared. Setting language as undetermined.
ERROR: Server error appeared. Setting language as undetermined.
INFO: Language codes: und, und, und
INFO: Merging done, removing old files.

for example we can see on the my english mistakes, they all say und when it should be eng and swe :)

  Stream #0:2(und): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
  Stream #0:3(und): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
  Stream #0:4(und): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler

if you watch the video on video player and switch subtitles. it just say und now.

pythonuser3856 commented 1 year ago

With the same example I also get an error from svtplay-dl at the stage of a merge. However when I watch the video using VLC it detects six .srt-files: three .SRT-files loaded with the tags [swe-partial], [Swedish], [English], and then three without tags. All six variants does work as subtitle files when watching the video with VLC.

Given that the example provides multiple equally suitable language options in .srt-files, is it reasonable to let svtplay-dl select an .srt-file without additional configuration of a preferred subtitle language ? I have so far avoided this dilemma by selecting the subtitle language from VLC (and don't use the -M option).

spaam commented 1 year ago

it seems to be some bug why its not removing those external files for some reason. that is why you see six files. three in the .mp4 file and three external.

hmm? i dont really follow what you mean 🤔 how can svtplay-dl select that? if we going to set a language in the metadata. i dont know what language swe-partial is. it should be spanish, maybe french? those parts came from the website.

maybe im just overthinking this.

pythonuser3856 commented 1 year ago

My point: The example video from URplay.se seems to be related to language training. Since it includes three equally suitable subtitle options; which one should svtplay-dl choose for merge without additional information ?

iwconfig commented 1 year ago

Heroku has discontinued their free tier unfortunately. There are some alternatives to Heroku that I will look into.

Services I've found interesting so far:

Another alternative is to not use an external api but include the source code into svtplay-dl, however just changing the api address is probably easier.

If you have any other suitable service with a free offering similar to Heroku free dynos, let me know.

iwconfig commented 1 year ago

Alright, I figured it would be a good idea to have multiple hosts for the api so I've now migrated it over to

However, I just noticed that the free tier on railway requires the admin to redeploy the app every month, which is not ideal.

Fly also requires adding a payment method and, if understand the documentation correctly, starts billing automatically if free tier limit is passed, which is not ideal.

Render seems to be the most Heroku-esque alternative so far. Still looking for other alternatives but this will do for now. Again, if you know of any other, holler.

spaam commented 1 year ago

oh its you running it. what do you need to run this? i have a vps that i have the website at. we could just move it to that host 🤔 instead of being depended on these free hosting stuff.

iwconfig commented 1 year ago

Ah, neat! We could do that too. The free tier on Render is comparable with what Heroku offered and the free dyno hours you got were plenty enough most of the time. Since the api now is up and running on Render we might as well use that too I mean. If your vps is down we can rely on Render or vice versa.

The source code is in a private repo. I can make you a collaborator if you want.

what do you need to run this?

Python 3

dobbelina commented 1 year ago

hmm? i dont really follow what you mean 🤔 how can svtplay-dl select that? if we going to set a language in the metadata. i dont know what language swe-partial is. it should be spanish, maybe french? those parts came from the website.

maybe im just overthinking this.

How large of a database is it that holds this metadata information? https://support.plex.tv/articles/200471133-adding-local-subtitles-to-your-media/ According to the article above under the section "Naming External Subtitle Files" it indicates that there are 2 standards that apply to naming the language code. That is ISO 639-1
And ISO 639-2 In 639-1 there are 184 languages with it's 639-2 3 letter counterpart. Couldn't one add these to an array and do a match kind of way'ish? There's a python library for the ISO639 standards.(old) An internal solution is always better.