Youtube/Music原生去广告
source link: https://garywu520.github.io/2022/03/08/Youtube-Music%E5%8E%9F%E7%94%9F%E5%8E%BB%E5%B9%BF%E5%91%8A/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Github: webapps-ads-removal
Introduction
The older User-Agent terminals are no longer the mainstream advertising target, so you can use the “–user-agent” parameter of the nativefier open source tool to forcefully disguise User-Agent to achieve ad filtering. Of course, not most User-Agents can remove ads, you need to explore and test together.
Dependencies
- macOS 10.9+ / Windows / Linux
- Node.js ≥ 12.9 and npm ≥ 6.9
npm install -g nativefier
From: https://github.com/nativefier/nativefier
Usage
Use nativefier to generate Web as App, example:
/<Path>/nativefier "https://example.com" \
--name Example \
--tray \
--internal-urls "(.*?)(accounts\.example\.com|example\.com)(.*?)" \
--user-agent 'Mozilla/5.0 (xxxxxx)'
Tested User-Agent
Replace the following User-Agent
App User-Agent Ad Removed Hide Play Youtube Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp) Yes Support Youtube-Music Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0 Yes SupportDifferent User-Agent access APP interface will be different, it is automatically adjusted according to the terminal
Other:
- ref: All User-Agent
- Submit suggestions to improve this project.
- If it involves infringement, please contact me to delete it in time.
License
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK