bvanheu / pytoutv

TOU.TV client library and user interfaces written in Python 3
96 stars 23 forks source link

Trying to download an episode gives a 404 error #132

Open djon2003 opened 5 years ago

djon2003 commented 5 years ago

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?

simark commented 5 years ago

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?

djon2003 commented 5 years ago

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.

simark commented 5 years ago

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.

djon2003 commented 5 years ago

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!.

simark commented 5 years ago

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).