La Fibre

Télécom => Peering Transit (appairage) => reseau Peering entre opérateurs => Discussion démarrée par: VixinG le 26 avril 2016 à 13:30:12

Titre: Twitch extension - English speaking
Posté par: VixinG le 26 avril 2016 à 13:30:12
I'm sorry for posting in English.

I'm VixinG, creator of the extension you're talking about.

I shouldn't be even responding here, but I feel like you guys are talking about me and I'm confused.
For the past 7 months I get a lot of messages daily/weekly about this extension. Many people thanking me / asking me questions.

I'm using the method implemented in the extension since early 2015, and I was always buffering on Twitch.
I'm from Poland. My ISP is Orange ADSL. I can watch max 3 minutes on Source before it breaks.

A few days ago I noticed that 3 or 4 servers are not working and other servers are not being as good as they used to.
I am using the extension myself, so I decided to update it. While I was working on an update I found a video of a popular French streamer who was advertising my extension, hosting it on mediafire, giving me no credit (he even said "I don't even know who made it"). This lack of credit made me add the info on the extension popup, along with twitch and twitter links, just so I can help people in other way.

(avec un bon gros bouton 'donate' donc il cherche a se faire un peu d'argent  :P )

It's not big.. it's a normal size link :-\
It's really optional. There are no ads or anything blocking you. You have to realize I'm not a programmer. I'm also unemployed but it's totally fine, I don't look for money.
Otherwise I wouldn't be making this extension in the first place. I even posted it's source on Github.
I have an idea to make this extension "legal" and allowed by Twitch, but it costs money which I don't have. It requires a server with multiple proxies/vpns to handle requests and redirect people just like this extension, but it's safe to Twitch.

I'm sorry I couldn't do more, but I had to take it down from Chrome Web Store.
I didn't want to risk anything by disobeying Twitch request.
I didn't know 30000 people are going to download it from other place, but when I found out I tried updating it. That's why I published it again for a very short time, just so people get the update.

D’ailleurs, je corrige. Vixing n'est pas de San Francisco... mais de Pologne!
Il ne sait même pas mettre un serveur UE par défaut pour lui.^^

Not always the closest server to you has the best connection! I buffer on every European server except London, but US-1 was the best 7 months ago, so I set it to default. Now Level3 and Dallas are the best.

Do you have any questions? I don't know how to help you. I know how Twitch works, how their servers work. That's why I made this extension.

Again, sorry for posting in English. I don't know French.
Titre: Twitch extension - English speaking
Posté par: Nico le 26 avril 2016 à 14:12:28
Sujet séparé pour créer ce thread en anglais. Thread initial : https://lafibre.info/peering/perring-orangetwitch/msg332069/#msg332069


Again, sorry for posting in English. I don't know French.
No problem, thanks a lot for posting here.
Titre: Twitch extension - English speaking
Posté par: DamienC le 26 avril 2016 à 15:10:12
Thanks a lot for this extension, now the live is not buffering anymore.
I can switch off VPN. Thanks again.
Titre: Twitch extension - English speaking
Posté par: Marin le 26 avril 2016 à 15:32:39
Hello,

Thank you for posting here, it's always an interesting contribution.

I have an idea to make this extension "legal" and allowed by Twitch, but it costs money which I don't have. It requires a server with multiple proxies/vpns to handle requests and redirect people just like this extension, but it's safe to Twitch.

When you're talking about "legal", I guess you are meaning "accepted by Twitch" rather than any consideration related to law? Albeit I don't have particular knowledge in Polish law, I'm pretty sure that changing a DOM localStorage value having an indirect impact on the routing of your traffic wouldn't have a reason to be forbidden in any close jurisdiction.

This could for sure importune them a bit in their seeking to manage and control their network interconnections, in the case the extension would undergo massive adoption, so in this case the request would seem reasonable anyway.

Note that as YouTube servers may force redirection to the preferred servers though HTTP redirects, if Twitch wanted to do same, it seems to be likely that they would have another way to stop this kind of add-on from working.

Considering the idea that you are enouncing in the end of your sentence: would your idea be to multicast the stream by receiving it once from Twitch to what you call your server and duplicating for each of the concurrent viewers using the aforementioned extension? If I'm thinking of it accurately, it would make you assume the equivalent of the load that Twitch would support for the equivalence of your user base, therefore only displacing the problem. Otherwise, I am still interested in hearing about it!
Titre: Twitch extension - English speaking
Posté par: kgersen le 26 avril 2016 à 16:09:04
Hi VixinG, welcome here.

It's not big.. it's a normal size link :-\
It's really optional. There are no ads or anything blocking you. You have to realize I'm not a programmer. I'm also unemployed but it's totally fine, I don't look for money.

I have no issue with the donate button, I was just surprised by it because it wasn't in the previous version so I was wondering what the intent was. Now I understand.

Also I was a bit annoyed by you for not mentioning my PR (pull request) on github. It's fine but you didn't even reply to it before closing it (and apparently merging some code from it) as it is customary to do in github (it's basic 'consideration' & courtesy between programmers).
Seen that you're not a programmer I understand now, so that's fine too.
Anyway, no point making a drama about 3 lines of code.

I also wrote to you on Reddit about the legal aspect of it. As I understand it now, it's not Google that removed it but you and only because Twitch asked you to do so the very first time. Thanks for clarifying that. I think your extension if legally ok , it's just about 'agreeing or not' to Twitch's request, which is your own decision.

I have an idea to make this extension "legal" and allowed by Twitch, but it costs money which I don't have. It requires a server with multiple proxies/vpns to handle requests and redirect people just like this extension, but it's safe to Twitch.

We have posted in the french part of this topic a way to do so using cheap proxy servers (<4€/month) and a Chrome proxy extension that redirects only Twitch traffic to them (for instance: Proxy SwitchyOmega (https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif)).
Some people here are willing to share freely their proxy so feel free to ask them access (but only for Twitch access ofc).

Unless you really want to make a business of this new 'project', of course, then that's another story.

To be complete, I think the best approach to 'please' everyone (=Twitch mainly) would be to do a generic version of your extension with no mention of 'Twitch' and without pre-including any Twitch servers in it.
It's the user, in the extension options  page that would then configure manually it for Twitch or any other online web service for that matter...

It's very easy to code actually:

just remove everything related to Twich in your extension (even the name) and put these in variables that the user will fill in in the option page of the extension.

For exemple, the user will have to enter

url =  "(http[s]?):\/\/vid.*\.hls\.ttvnw\.net\/(.*\.ts)$"
replacement =  "$1//video20.fra01.hls.ttvnw.net/$2"

Actually such an extension probably already exists ...(for exemple Requestly  (https://chrome.google.com/webstore/detail/requestly/mdnleldcmiljblolnjhpnblkcekpdkpa)but I haven't tried to redirect Twich streams with it).


Titre: Twitch extension - English speaking
Posté par: turold le 26 avril 2016 à 16:22:32
Otherwise I wouldn't be making this extension in the first place. I even posted it's source on Github.
[...]
I didn't know 30000 people are going to download it from other place, but when I found out I tried updating it. That's why I published it again for a very short time, just so people get the update.
Github by ZIP: no update, other ID extension. Random ID during the install. But I personally managed to have got the info that was available again on CWS, and installed from the CWS before his re-deleting.
crx4chrome website: The ID of CWS is in the URL. So I suppose it's good for the update.

Not always the closest server to you has the best connection! I buffer on every European server except London, but US-1 was the best 7 months ago, so I set it to default. Now Level3 and Dallas are the best.
Not false. I'm in France, and I have to use the server which is at Wahsington, closer, for fluency.
Titre: Twitch extension - English speaking
Posté par: VixinG le 26 avril 2016 à 16:35:51
When you're talking about "legal", I guess you are meaning "accepted by Twitch" rather than any consideration related to law? Albeit I don't have particular knowledge in Polish law, I'm pretty sure that changing a DOM localStorage value having an indirect impact on the routing of your traffic wouldn't have a reason to be forbidden in any close jurisdiction.

Yes, I meant accepted by Twitch. I already talked to the Product Manager of Video at Twitch several months ago about it. Just before he asked me to take my extension down, and I did.

This could for sure importune them a bit in their seeking to manage and control their network interconnections, in the case the extension would undergo massive adoption, so in this case the request would seem reasonable anyway.

To my knowledge they didn't do anything that would improve our user experience when it comes to the routing/buffering problem. It is just as it was in 2014 and there haven't been any signals from their side promising a change. From what I've seen they are working on Whispers, Friends list and Stream Feed.

The idea I presented to them was me hosting a server running multiple proxies or VPNs from different places around the world which would query their stream API, getting a list of available servers for a specified channel.
Users would open streams and the extension would gather info, send it to the server which would generate a list of servers available for this channel.

So basically:
User opens Twitch stream. Extension sends the channel name to the Server. Server queries local database for the channel. If not found, Server queries Twitch API from US, EU, SA, Asia, AU simultaneously and saves results in local database. Extension tries again, Server finds a match, responds with a list of servers to the Extension.

That's the safest way without breaking Twitch servers. My extension is potentially disruptive, because if 30k people drops on the same server, eg. video20.Fra01, it will either shut down (but I guess/hope they have security measures for that) or lag other users on that server/node.

I asked them 7 months ago if they could add a server switch option on the new html5 player they introduced a while ago, with a drop down list of servers that are available for the currently watched streamer. They said it's too complicated but they are "constantly working" on improving blah blah :P
Titre: Twitch extension - English speaking
Posté par: underground78 le 26 avril 2016 à 16:49:40
Doing that would mean doing Twitch (or ISPs) job basically, that hardly seems like something you should be doing.
Titre: Twitch extension - English speaking
Posté par: VixinG le 26 avril 2016 à 16:56:05
Doing that would mean doing Twitch (or ISPs) job basically, that hardly seems like something you should be doing.

If I didn't do it, I'd buffer 24/7. And you. And 30k other people. As much as I like Chatty and Livestreamer, I prefer having an actual working website and this extension actually made that happen :D
/edit: unless you mean the idea I'm proposing.. yeah, but do you expect Twitch to do something like that? I don't :/

Also I was a bit annoyed by you for not mentioning my PR (pull request) on github. It's fine but you didn't even reply to it before closing it (and apparently merging some code from it) as it is customary to do in github (it's basic 'consideration' & courtesy between programmers).

I didn't know what was that pull request about. You titled it "DE is now 14 not 7" or something like that. Sorry for that, I'm not a programmer unless I really want to do something useful (like this extension).
I also did something terrible and had to remove my branch and all history and reupload just the final 1.1.0. I'm a git newbie.

To be complete, I think the best approach to 'please' everyone (=Twitch mainly) would be to do a generic version of your extension with no mention of 'Twitch' and without pre-including any Twitch servers in it.
It's the user, in the extension options  page that would then configure manually it for Twitch or any other online web service for that matter...

Yep, I was thinking about making it like this, but it was just simpler to update the server list, add storage save and add my contact info (Twitter, twitch) and donation link in case I want to start the proxy extension.
I can spend some time and make an extension like that, or replace this one entirely and change name and everything.
Titre: Twitch extension - English speaking
Posté par: underground78 le 26 avril 2016 à 17:07:38
If I didn't do it, I'd buffer 24/7. And you. And 30k other people.
Sure and that's nice of you but I think it is not realistic to think that you can provide a server for 30k (and maybe more) users. That would be both technically complex and expensive, that's why I say it's doing Twitch and ISP jobs.
Titre: Twitch extension - English speaking
Posté par: VixinG le 26 avril 2016 à 17:25:14
Sure and that's nice of you but I think it is not realistic to think that you can provide a server for 30k (and maybe more) users. That would be both technically complex and expensive, that's why I say it's doing Twitch and ISP jobs.
You are right.
I can't even suggest such a thing to my ISP. I have Orange ADSL, I don't know what's French experience with Orange, but here we don't have much to say about peering or routing.
I suggested this a few times to Twitch and heard the same response over and over.
Titre: Twitch extension - English speaking
Posté par: Marin le 26 avril 2016 à 17:41:00
The idea I presented to them was me hosting a server running multiple proxies or VPNs from different places around the world which would query their stream API, getting a list of available servers for a specified channel.
Users would open streams and the extension would gather info, send it to the server which would generate a list of servers available for this channel.

So basically:
User opens Twitch stream. Extension sends the channel name to the Server. Server queries local database for the channel. If not found, Server queries Twitch API from US, EU, SA, Asia, AU simultaneously and saves results in local database. Extension tries again, Server finds a match, responds with a list of servers to the Extension.

That's the safest way without breaking Twitch servers. My extension is potentially disruptive, because if 30k people drops on the same server, eg. video20.Fra01, it will either shut down (but I guess/hope they have security measures for that) or lag other users on that server/node.

Okay, so if I understand well you still want to route user traffic directly to servers the geolocation system doesn't intend to, but just in a more controlled manner by operating the load balancing between multiple of these in a manner you control rather than asking the user to choose an arbitrary value, and still not proxying any of the video content itself. I guess that a corollary is that your script will handle the switching to a network lane that is not saturated too.

The matter of choosing a server that wasn't meant for the user to be chosen still implies a variable oversizing of Twitch's infrastructure for the other country or geographic area, so the odds of this "not annoying Twitch at all" aren't really predictable (as hardware capacity may as well play a role as network capacity here), nevertheless this should still function better overall than the original implementation.

It has been mentioned that you could use a paying proxy or VPN in order to fetch the streams URL: I think there should be better or free alternatives, such as using Tor directed to a exit node from a particular country. You likely can do that, if you use the public API (https://onionoo.torproject.org/) in order to fetch those, and then use the "ExitNodes $node_id_here" directive in the Tor configuration. However, this is a bit of a hack.

Also, I don't know Twitch content delivery process well, but noticed it included IATA codes (https://en.wikipedia.org/wiki/International_Air_Transport_Association_code) in what seemed to be a regular manner in the hostname of servers. Just out of curiosity, can you tell you can't generate or check by yourself the matter of the availability of video content without using a proxy, maybe by engaging multiple non-network heavy parallel requests on the side of your server? I think I will check the issue and the available Twitch API endpoints in more detail later.

Sorry for that, I'm not a programmer unless I really want to do something useful (like this extension).

There's never a good reason not to program ;)

I don't know what's French experience with Orange, but here we don't have much to say about peering or routing.

It's the same group but the networks and peering policies are likely distinct. Orange France has globally a good peering and transit quality, but not a totally open one and may still ask other actors to pay in order to interconnect to their network.
Titre: Twitch extension - English speaking
Posté par: underground78 le 26 avril 2016 à 17:47:44
Orange France has globally a good peering and transit quality, but not a totally open one and may still ask other actors to pay in order to interconnect to their network.
Some might say it's a quite optimistic way to put it...
Titre: Twitch extension - English speaking
Posté par: VixinG le 26 avril 2016 à 18:10:40
Just out of curiosity, can you tell you can't generate or check by yourself the matter of the availability of video content without using a proxy, maybe by engaging multiple non-network heavy parallel requests on the side of your server? I think I will check the issue and the available Twitch available API endpoints in more detail later.

Twitch names their server clusters with IATA, yes.
Twitch has many ingest servers where you send your stream and they all forward it to the main one which is in San Francisco, CA. So no matter where you stream from, it always goes to San Francisco.
Now, when a broadcaster starts his stream, he gets assigned a set of server clusters (for example: san francisco, frankfurt, prague, miami) and a set of server nodes (video12-video20, video36-video50, on each of those servers). When users connect to those servers, those servers pull the data from San Francisco and serve it. It always originates at San Francisco. It's their mother base.
But even if Amsterdam and London, or video2 and video71 aren't assigned to broadcaster, it doesn't mean users can't connect to them.
You can. Using my extension. If user connects to a server/node which is not assigned to the broadcaster, it still works like it is. The server pulls data from San Francisco and serves it to users on this node.
That's why it's potentially disruptive. When that happens, users are using server resources which are not assigned for this task, and may cause the "legitimate" users experience issues.

There is no way of knowing what servers and nodes are available to a broadcaster, unless you connect to Twitch API (Usher) from each location where Twitch has their servers:
Level3, edgecast, san francisco, seattle, san sose, chicago, washington, new york, los angeles, miami, stockholm, london, amsterdam, paris, frankfurt, warsaw, prague, sydney, hong kong, seoul, tokyoTwitch automatically assigns you to the closest available node based on your IP geolocation, so unless you have TOR/Proxy/VPN, there's little you can do.

The way I described (with proxies around the world) is safe for Twitch because it uses their own network balancer.
If a broadcaster has only London and Amsterdam and you query the API from Korea and Washington, you will still get assigned to London and Amsterdam.
Titre: Twitch extension - English speaking
Posté par: VixinG le 26 avril 2016 à 21:38:34
There was actually a url query called "?cdn=", which you could add to a stream m3u8 link and it would redirect you automatically, and it was a part of Twitch system, so no tampering from my side.
So something like "?cdn=fra01" would redirect you to Frankfurt, no matter where are you from.
I used it myself. I posted a guide on /r/Twitch subreddit how to use Switcheroo Redirector which just added "?cdn",  and it was the simplest mod, fixing all the issues.

The next few days Twitch removed it because of me.
I asked them why it was removed. They said it was deleted because I found out and it could be used to bypass their system (which forces you onto server).
They removed their own implementation of server switching URL query, instead of modifying it to pass through a load balancer or something...
That's when I decided to make the extension.

I care too much when I see a lot of people who have the same issue as me. I know how it is not being able to watch even on Medium, because of Twitch terrible routing and the lack of ability to let us switch servers.
Titre: Twitch extension - English speaking
Posté par: minidou le 27 avril 2016 à 21:45:44
I like Chatty and Livestreamer
any chance you could look at a livestreamer plugin that would allow to choose twitch cluster so I don't have to?
Titre: Twitch extension - English speaking
Posté par: cali le 27 avril 2016 à 23:22:11
I'm from Poland. My ISP is Orange ADSL. I can watch max 3 minutes on Source before it breaks.

Why did you subscribe to orange.pl? Afaik there is no area in Poland where orange.pl is the only available ISP. Poland has far more small regional/metropolitan ISPs than France.
Titre: Twitch extension - English speaking
Posté par: VixinG le 27 avril 2016 à 23:35:52
Why did you subscribe to orange.pl? Afaik there is no area in Poland where orange.pl is the only available ISP. Poland has far more small regional/metropolitan ISPs than France.
Orange (Neostrada) is the only available ISP in countless amount of places in Poland. I live in a big city and the only ISP I can have in this HOUSE (there are like 4 other for flats in my area) is Orange.
any chance you could look at a livestreamer plugin that would allow to choose twitch cluster so I don't have to?
I don't think that's possible without modifying livestreamer source (which I believe is in Python?) and it would take me a lot of time.
Titre: Twitch extension - English speaking
Posté par: cali le 27 avril 2016 à 23:42:36
Orange (Neostrada) is the only available ISP in countless amount of places in Poland. I live in a big city and the only ISP I can have in this HOUSE (there are like 4 other for flats in my area) is Orange.

You should just ask them to connect you, they may ask you to pay for the connection but that will work. I've done that dozens of time from flats where orange.pl was supposedly the only crap available.
Titre: Twitch extension - English speaking
Posté par: VixinG le 28 avril 2016 à 03:01:04
You should just ask them to connect you, they may ask you to pay for the connection but that will work. I've done that dozens of time from flats where orange.pl was supposedly the only crap available.
Why people in France, on this forum have a problem with Orange and Twitch?
Twitch just recently opened a new server in Warsaw (waw01) and I have 330 ms ping to it, with download speed 50kb/s. This ISP doesn't make any sense.
Titre: Twitch extension - English speaking
Posté par: cali le 28 avril 2016 à 11:49:15
Why people in France, on this forum have a problem with Orange and Twitch?
Twitch just recently opened a new server in Warsaw (waw01) and I have 330 ms ping to it, with download speed 50kb/s. This ISP doesn't make any sense.

Because orange.pl just as orange.fr refuses to establish interconnections with other networks, that's called a closed peering policy. orange.fr/pl has developed racketeering to make other networks which should normally be interconnected with orange.pl pay for this very interconnection. Fortunately the racket is not working so well so orange.pl is basically not interconnected with anything.
Titre: Twitch extension - English speaking
Posté par: TroniQ89 le 02 mai 2016 à 13:10:42
Hi

Thank you a lot for your extension.

We have Orange ISP too in France...
Orange.fr and Orange.pl have both problems with Twitch : https://lafibre.info/peering/perring-orangetwitch/

I'm using Free.fr ISP and Free has the same problems...
Titre: Twitch extension - English speaking
Posté par: Paul le 02 mai 2016 à 13:33:02
I am on Free.fr too. I tested all the available servers, and Amsterdam, Level3 CDN and Chicago seem to be the only ones that work properly.

On the other servers, at best it buffers every 3-10 seconds, at worst the video does not even display (it buffers indefinitely).
Titre: Twitch extension - English speaking
Posté par: TroniQ89 le 02 mai 2016 à 18:29:35
I am on Free.fr too. I tested all the available servers, and Amsterdam, Level3 CDN and Chicago seem to be the only ones that work properly.

On the other servers, at best it buffers every 3-10 seconds, at worst the video does not even display (it buffers indefinitely).

For me it's Stockholm ;)
Titre: Twitch extension - English speaking
Posté par: TroniQ89 le 06 juillet 2016 à 01:46:06
Sorry, the last post was few months ago, but I had a question :

Can Twitch server switcher extension be forked for YouTube to change GGC ? It can be auto-edited before the load of the video (with HTML5 player, but I don't think if it could work for Flash player).

I'm not a extension developer so I don't know if it could be hard to make.