Momo707577045 / m3u8-downloader

m3u8 视频在线提取工具
5.97k stars 1.15k forks source link

改下博主的代码,91下载时文件名改为页面title,点击注入下载后自动下拉到最下面 #59

Closed rzyao closed 2 years ago

rzyao commented 2 years ago

在油猴里编辑脚本 m3u8Append.addEventListener('click', function()上面加一行代码,获取页面title, var title = document.getElementsByTagName('title')[0].innerHTML title = title.replace(/\s*/g,""); 修改脚本里这段代码 if (m3u8Target) { script = script.replace(url: '', // 在线链接, url: '${m3u8Target}',title:'${m3u8Target}'); } 修改为 if (m3u8Target) { script = script.replace(url: '', // 在线链接, url: '${m3u8Target}',titlename:'${title}',); script = script.replace(this.formatTime(this.beginTime, 'YYYY_MM_DD hh_mm_ss'), this.titlename); script = script.replace(this.formatTime(this.beginTime, 'YYYY_MM_DD hh_mm_ss'), this.titlename); } 这样下载时文件名就是title了 再把alert('注入成功,请滚动到页面底部')替换为 document.documentElement.scrollTop = 10000 点击注入下载后自动下拉到最下面