您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Attempt to read the .torrent file and fill in the artist and album
当前为
// ==UserScript== // @name PTH Autofill from torrent // @version 0.1 // @description Attempt to read the .torrent file and fill in the artist and album // @author Chameleon // @include http*://passtheheadphones.me/* // @grant none // @namespace https://greasyfork.org/users/87476 // ==/UserScript== (function() { 'use strict'; document.getElementById('file').addEventListener('change', fileAdded, false); })(); function fileAdded(event) { var file=event.target.files[0]; if(!file) return; var spl=file.name.split(' - '); var artist=spl[0]; document.getElementById('artist').value=artist; var album=spl[1]; document.getElementById('title').value=album; return; var r=new FileReader(); r.onload=readFile; r.readAsText(file); } function readFile(event) { var contents=event.target.result; console.log(contents); }