spaam / svtplay-dl

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

Show a nice message instead of an error message when subtitles are missing? #85

Open Sopor opened 10 years ago

Sopor commented 10 years ago

When using the -S with or without the --force-subtitle i get this error message when there are no subtitles: ERROR: Something wrong with that url ERROR: Error code: 404 It would be better to show something like this instead: No subtitle available for this episode or what do you think?

spaam commented 10 years ago

Sounds like a good idea.

spaam commented 10 years ago

what video did you get that error btw?

Sopor commented 10 years ago

http://www.tv3play.se/program/hasselhoff-en-svensk-talkshow/361295

Sopor commented 10 years ago

If an episode is missing it will also get the error code 404 and it will not download all the episodes if i use the -A:

svtplay-dl -A http://www.tv10play.se/program/vralak-i-sin-city
INFO: Episode 1 of 8
INFO: Outfile: vralak-i-sin-city-avsnitt-1-tv10-play.ts
INFO: File already exists. use --force to overwrite
INFO: no thumb requested
INFO: Episode 2 of 8
INFO: Outfile: vralak-i-sin-city-avsnitt-2-tv10-play.ts
INFO: File already exists. use --force to overwrite
INFO: no thumb requested
INFO: Episode 3 of 8
ERROR: Something wrong with that url
ERROR: Error code: 404

So it would be great if it could continue to the next episode instead of halt on every error.

spaam commented 10 years ago

mm.. should remove all the sys.exit things to the next version.

Sopor commented 10 years ago

Hmm, this was strange. I can watch episode 3 on http://www.tv10play.se/program/vralak-i-sin-city/400187 but i can't download it. I have even tried as a single episode but i get the same error. svtplay-dl http://www.tv10play.se/program/vralak-i-sin-city/400187 ERROR: Something wrong with that url ERROR: Error code: 404

spaam commented 10 years ago

after the rewrite. we fetch HLS and RTMP info. then later choose which one to download. the problem is that HLS playlist send 404 when we trying to access it...

spaam commented 10 years ago

and because of that 404 error message we do an sys.exit.. you can see that when you add -v to the script for more verbose log.

spaam commented 10 years ago

here is a patch for a hack to fix the problem.

diff --git a/lib/svtplay_dl/service/viaplay.py b/lib/svtplay_dl/service/viaplay.py
index 2c165c6..3b357b9 100644
--- a/lib/svtplay_dl/service/viaplay.py
+++ b/lib/svtplay_dl/service/viaplay.py
@@ -106,7 +106,10 @@ class Viaplay(Service, OpenGraphThumbMixin):
                 yield RTMP(copy.copy(options), filename, 800)

         if streamj["streams"]["hls"]:
-            streams = hlsparse(streamj["streams"]["hls"])
+            try:
+                streams = hlsparse(streamj["streams"]["hls"])
+            except SystemExit as e:
+                return
             for n in list(streams.keys()):
                 yield HLS(copy.copy(options), streams[n], n)

if you want to download the episode right now. cd /path/to/svtplay-dl && patch -p1 < /path/to/file/with/patch/info

Sopor commented 10 years ago

Now it will use RTMPDump and the resolution was much lower, but at least it works :thumbsup:

dentarg commented 8 years ago

solved?

$ svtplay-dl --require-subtitle http://www.svtplay.se/video/7241917/fallet-o-j-simpson-american-crime-story/fallet-o-j-simpson-american-crime-story-sasong-1-the-dream-team
INFO: No subtitles available

cc @spaam