-
Notifications
You must be signed in to change notification settings - Fork 0
/
pledit.htm
89 lines (80 loc) · 3.5 KB
/
pledit.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<HTML>
<HEAD>
<script>
var filecon='';
function download(filename,text){
var element = document.createElement('a');
element.setAttribute('href','data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download',filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
function addinfo(urldata,name2,type,hd){
var name =name2.replace(/\s/g,'*')
var sp = name.split('.');
var tof = '';
if(type !='tn' && ((type != 'dl') || (document.getElementById("ignoretime").checked==true))){
tof = type + ' ' + urldata + ' ' + name;
if(type=='vi' && hd==true){
tof += '\nvo ' + urldata + ' ' + name;
}
}else{
if(type == 'tn'){
tof = type + ' ' + urldata + ' NONEED';
}else{
if(sp.length < 2 && type=='dl'){
tof = type + ' ' + urldata + ' ' + sp[0] + '(%s)';
}else{
tof = type + ' ' + urldata + ' ' + sp[0] + '(%s).' + sp[1];
}
}
}
filecon += tof + '\n';
}
function yturl(url){
var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
url = (decodeURIComponent(url));
return (url.match(p)) ? RegExp.$1 : false ;
}
function plurl(url){
var p = new RegExp('youtube\..+?/playlist.*?list=(.*?)(?:&|/|$)|youtube\..+?/watch.*?list=(.*?)(?:&|/|$)|youtu\.be/.*?/.*?list=(.*?)(?:&|/|$)|youtube\..+?/embed/.*?/.*?list=(.*?)(?:&|/|$)');
url = (decodeURIComponent(url));
return (url.match(p)) ? RegExp.$1 : false ;
}
function parseinfo(){
if(document.getElementById("vi").checked == true){
addinfo(yturl(document.getElementById("urldata").value),document.getElementById("filenames").value,'vi',document.getElementById("HD").checked);
}
if(document.getElementById("pl").checked == true){
addinfo(plurl(document.getElementById("urldata").value),document.getElementById("filenames").value,'pl',false);
}
if(document.getElementById("dl").checked == true){
addinfo(document.getElementById("urldata").value,document.getElementById("filenames").value,'dl',false);
}
if(document.getElementById("tn").checked == true){
addinfo(yturl(document.getElementById("urldata").value),document.getElementById("filenames").value,'tn',false);
}
}
function startdl(){
download(document.getElementById("downloadfn").value + '.txt',filecon.substring(0,filecon.length -1));
}
</script>
</HEAD>
<BODY>
<H1>Wii TYTD Playlist Editor</H1>
<form>
For File Name Use "*" As Space
URL:<input type="text" id="urldata"><br>Filename:<input type="text" id="filenames"><input type="button" value="Add" onclick="parseinfo()"><br>
<input type="radio" name="type" id="vi" value="Video">Video
<input type="radio" name="type" id="pl" value="Playlist">Playlist
<input type="radio" name="type" id="dl" value="Download">Download
<input type="radio" name="type" id="tn" value="Thumbnail">Thumbnail<br>
<input type="checkbox" name="type" id="ignoretime" value="Time">Ignore time in downloader<br>
<input type="checkbox" name="type" id="HD" value="DownloadHD">Download HD Video(Video and Audio Seprate)<br>
Output Filename:<input type="text" value="out" id="downloadfn">.txt<input type="button" value="Download" onclick="startdl()"><br>
</form>
<A HREF="wiiytdpltxtcreator.exe">.NET 4 Version</A>
</BODY>
</HTML>