Created
March 11, 2018 11:41
-
-
Save maple3142/d1413a474399ea44640bbf4220a41edf to your computer and use it in GitHub Desktop.
convert userscript's metablock to javascript object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const m=` | |
// @name 動畫瘋工具箱 | |
// @namespace https://blog.maple3142.net/ | |
// @version 0.4 | |
// @description 取得動畫的 m3u8 網址,下載彈幕為 json,去除擋廣告的警告訊息 | |
// @author maple3142 | |
// @match https://ani.gamer.com.tw/animeVideo.php?sn=* | |
// @require https://cdn.jsdelivr.net/npm/m3u8-parser@4.2.0/dist/m3u8-parser.min.js | |
// @grant none | |
` | |
const result=Object.assign(...m.split('\n').map(s=>/@(\w*)\s*(.*)/.exec(s)).map(r=>({[r[1]]:r[2]}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment