RblSb / SyncTube

Synchronized video viewing with chat and other features (one-channel web service)
MIT License
247 stars 52 forks source link

Proxy video for IP-restricted sites #22

Closed ekrekeler closed 3 years ago

ekrekeler commented 3 years ago

There are some streaming sites that are restricted by IP address. For example, I use streamtape.com to share videos with others. However, when I use the video URL extracted from the webpage in SyncTube, it will play fine on my end but will not for people with different external IP addresses.

I know that SyncTube has a proxy function. I have tested adding a URL with synctube.example.com:4200/proxy?url=[video_url] and this works for remote viewers. Would it be possible to have the browser fall back to using the proxy if the video fails to play? Or at least add an option when adding the video to playlist to use the proxy instead of directly connecting?

For Streamtape specifically, the connection in the browser returns HTTP error 403 for users with a different external IP address. Also, Streamtape was the only example I could find of this. Most other streaming sites use browser cookies instead of restricting IP address, but this would be much more difficult to implement. I can get by with Streamtape and SyncTube if I can get it working with the proxy function.

RblSb commented 3 years ago

Not sure if there is other sites with ip restriction and this fallback should exist. Dont really know how bad would be for server to proxy big video file at least for ten users, because that function mostly for subs and other files, need some investigation. Also, should be easy to write plugin, that will listen to video.onerror and replace video.src to proxy version on that event, maybe that's a good way here.

ekrekeler commented 3 years ago

Thanks for the reply.

I have taken your suggestion and written a plugin that works for me. I will share the repo tomorrow in case anyone else is interested.

ekrekeler commented 3 years ago

As promised, here is the repo if anyone else stumbles across this looking for a solution. Going forward with the closure of this issue.