Finding Open Graph Tags On Youtube
I'm working on a Tampermonkey script to hide related videos on youtube if the og:video:tag contains 'League of Legends'. When I use the Open Graph Debugger (link) it find many tags
Solution 1:
YouTube video source contains those tags only if the userAgent
is
facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
or (I used this in my test)
facebookexternalhit/1.1
You can test these by adding a new device to DevTools with those user agents. I am not sure you want to use these tags, but you have two options:
- If there is backend processer for finding these tags, you can switch the user agent to appropriate one there.
- If you're working on a browser extension, you should set up a proxy that does the above for you. Send the video permalink and return an object of tags.
Post a Comment for "Finding Open Graph Tags On Youtube"