pytoutv icon indicating copy to clipboard operation
pytoutv copied to clipboard

Trying to download an episode gives a 404 error

Open djon2003 opened this issue 6 years ago • 5 comments
trafficstars

I am using Captvty to download Virginie and some episodes were not downloadable. So, I installed myself a VM with Debian and installed pytoutv. Unfortunately it gives me an HTTP 404 error when trying to get the same episodes.

i.e. "toutv fetch Virginie S09E10"

"toutv fetch Virginie S09E11" works fine, as in Captvty.

Does someone know why?

djon2003 avatar Feb 10 '19 02:02 djon2003

I can't tell for sure, but it looks similar to #130. There were also some intermittent issues recently, like #131. I think we are using an old API, that is perhaps not as reliable as what the current mobile apps use. Does the same episode work in one of the official tou.tv apps?

simark avatar Feb 10 '19 03:02 simark

It does work on the website and (I just installed) on Android app. Is there a plan to upgrade to the latest API? Otherwise, having some cues, I could do it.

djon2003 avatar Feb 10 '19 03:02 djon2003

The task is up grabs :). I think I took a look at some point, and it was not too obvious. The most basic way to reverse the API is to use something like mitmproxy to see what requests the application or web page does. Then you try to replicate it in toutv's code. I didn't have much success, but I don't have any particular knowledge of video formats and distribution, so I was a bit lost. Maybe somebody with some experience in that would have more success.

simark avatar Feb 10 '19 04:02 simark

Neither I have... :( Once I looked using Wireshark... but stopped really quickly to find a software already doing it. Unfortunately, only few episodes aren't downloadable.

I am not a video expert at all, but there is nothing I wanted to do I coud not achieve. So, tell me what were the problems you had, maybe I could start from there. More over, I barely coded in Python, but hey, what's the problem!? LOL!.

djon2003 avatar Feb 10 '19 04:02 djon2003

It's been a while, I don't recall what didn't work exactly. But I was try to do the same requests as what I was seeing, and I wouldn't get the same result as the official got. If I knew what I was doing wrong, I wouldn't have any problem :)

It might be easier to use something like mitmproxy rather than Wireshark, if the traffic is over https (in Wireshark, you just see encrypted streams).

simark avatar Feb 10 '19 04:02 simark