Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user agent workaround for YouTube TV #1162

Closed
MrSol0 opened this issue Nov 23, 2019 · 4 comments
Closed

Add user agent workaround for YouTube TV #1162

MrSol0 opened this issue Nov 23, 2019 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@MrSol0
Copy link

MrSol0 commented Nov 23, 2019

Is your feature request related to a problem? Please describe.
My problem is that our TV script that was based on Youtube TV no longer works because youtube limited access to unothorized devices, to fix that i need to add a new user-agent.

Describe the solution you'd like
i want to be able to edit the user-agent, maybe using SetBrowserProperty to be able to change it to something like "Mozilla/5.0 (SMART-TV; Linux; Tizen 4.0.0.2) AppleWebkit/605.1.15 (KHTML, like Gecko) SamsungBrowser/9.2 TV Safari/605.1.15", and then i will be able to access youtube.com/tv for our Smart TV.

Describe alternatives you've considered
N/A

Additional context
N/A

@MrSol0 MrSol0 added the enhancement New feature or request label Nov 23, 2019
@Dutchman101
Copy link
Member

Dutchman101 commented Nov 24, 2019

Even though it would be practical for some scripters, I doubt if it would be appropiate for MTA to facilitate breaching the YouTube ToS/circumvent something that Google has put in place for their own reasons.

For more information, refer to:

  1. https://www.slashgear.com/youtube-is-discontinuing-its-tv-interface-for-web-browsers-13591695/
  2. https://mashable.com/article/youtube-leanback-shutting-down/

By now these changes have taken effect, and as we know this broke plenty of scripts around MTA.

They seem to have specific reasons for keeping it working on certain user agents (like the ones you mentioned), and if they cannot block non-smart TV access in a more reliable way, the last thing we want is that MTA's CEF will be detected and restricted by YouTube because of work-arounds.

I think that if a new browser property (to manipulate user agent) will be requested at a time where this situation isn't actual, and without this workaround as the main motivation, it would be pretty much welcomed as an useful feature.

By the way, this post is entirely my personal opinion.

@patrikjuvonen patrikjuvonen changed the title SetBrowserProperty -- Add ability to edit user-agent for Browser. Add ability to edit user-agent on CEF browser Nov 24, 2019
@MrSol0
Copy link
Author

MrSol0 commented Nov 24, 2019

Even though it would be practical for some scripters, I doubt if it would be appropiate for MTA to facilitate breaching the YouTube ToS/circumvent something that Google has put in place for their own reasons.

For more information, refer to:

  1. https://www.slashgear.com/youtube-is-discontinuing-its-tv-interface-for-web-browsers-13591695/
  2. https://mashable.com/article/youtube-leanback-shutting-down/

By now these changes have taken effect, and as we know this broke plenty of scripts around MTA.

They seem to have specific reasons for keeping it working on certain user agents (like the ones you mentioned), and if they cannot block non-smart TV access in a more reliable way, the last thing we want is that MTA's CEF will be detected and restricted by YouTube because of work-arounds.

I think that if a new browser property (to manipulate user agent) will be requested at a time where this situation isn't actual, and without this workaround as the main motivation, it would be pretty much welcomed as an useful feature.

By the way, this post is entirely my personal opinion.

i disagree and btw there is no way for youtube to restrict or even detect MTA's CEF as it's like any other browser, not just that but there is apps in the google store that do that, that are there for some times now. i think this will benefit many people and my case is no exception, i advice MTA Team side with the developers and enable us to do more instead of trying to find reasons that have no merit to block it, and i don't think this breaks any ToS, it's just a feature.

thanks.

@qaisjp
Copy link
Contributor

qaisjp commented Nov 24, 2019

I...

  • suspect a reason they blocked access for regular browsers is to absolve themselves of the responsibility to keep things stable for regular browsers.
  • don't think it's technically possible for Google to block MTA without blocking all of CEF - they can via user agent, but I doubt they would
  • am not sure of the implications of letting servers change the user-agent, but think that we could hardcode a user-agent switch for youtube.com/tv URLs

Pull requests welcome (if you can figure out exactly what string they are looking for in the user agent)

@qaisjp qaisjp added this to the Backlog milestone Nov 24, 2019
@qaisjp
Copy link
Contributor

qaisjp commented Nov 24, 2019

SMART-TV; Tizen 4.0 is the minimal user agent to get YouTube TV to work:

curl "https://www.youtube.com/tv" -v --user-agent "SMART-TV; Tizen 4.0"

And it works if you simply append the above string to the user agent:

curl "https://www.youtube.com/tv" -v --user-agent "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36; SMART-TV; Tizen 4.0"

assuming that CEF Forum • How to get default user agent? is accurate

qaisjp added a commit to qaisjp/mtasa-blue that referenced this issue Feb 2, 2020
@qaisjp qaisjp changed the title Add ability to edit user-agent on CEF browser Add user agent workaround for YouTube TV Feb 2, 2020
@qaisjp qaisjp closed this as completed in e549fec Feb 2, 2020
@qaisjp qaisjp modified the milestones: Backlog, 1.6 Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants