-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patho.html
More file actions
89 lines (87 loc) · 3.28 KB
/
o.html
File metadata and controls
89 lines (87 loc) · 3.28 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function copyUrl2(){
var Url2=document.getElementById("skydrive_new");
Url2.select();
// 选择对象
document.execCommand("Copy");
// 执行浏览器复制命令
alert("已复制好,可贴粘。");
}
//点击转码获取链接方法
function getLink(){
//获取原链接
var skydrive_old = document.getElementById("skydrive_old");
//获取格式
var file_value = "";
var file_type = document.getElementsByName("file_type");
for(var i=0; i<file_type.length; i++){
if(file_type[i].checked){
file_value = file_type[i].value;
break;
}
}
var file_other = document.getElementById("file_other");
var file_other_text = document.getElementById("file_other_text");
var skydrive_new = document.getElementById("skydrive_new");
//非空验证
if(skydrive_old.value.length == 0){
alert("链接不能为空");
skydrive_old.focus();
return false;
}
//提取原链接中关键代码
var skydrive_old_value = skydrive_old.value;
var arg_and = skydrive_old_value.indexOf('&authkey=');
//判断链接里是否有“&”
if(arg_and < 0){
skydrive_old_value = skydrive_old_value.substring(skydrive_old_value.indexOf('=')+1);
}else{
skydrive_old_value = skydrive_old_value.substring(skydrive_old_value.indexOf('&resid=')+7,arg_and);
}
//拼接最终结果
if(file_value == 'other'){
skydrive_new.value = "http://storage.live.com/items/"+skydrive_old_value+"?filename=a."+file_other_text.value;
}else{
skydrive_new.value = "http://storage.live.com/items/"+skydrive_old_value+"?filename=a."+file_value;
}
}
function fileOtherTextChange(){
if(file_other.checked==true){
file_other_text.disabled=false;
file_other_text.focus();
}else{
file_other_text.disabled=true;
}
}
</script>
<title>Insert title here</title>
</head>
<body>
<div>> OneDrive网盘文件永久外链获取</div>
<p>
分享链接:
<input type="text" style="width: 405px" id="skydrive_old" value="" onMouseOver="this.select()"
placeholder="例如:https://onedrive.live.com/redir?resid=B87E3BA637541E42%21165" />
<input type="button" id="btn" value="获取" onClick="getLink()" /></p>
<p>
文件扩展名:
<input type="radio" name="file_type" id="file_mp3" value="mp3" onchange="fileOtherTextChange()" checked />mp3
<input type="radio" name="file_type" id="file_png" value="png" onchange="fileOtherTextChange()" />png
<input type="radio" name="file_type" id="file_png" value="gif" onchange="fileOtherTextChange()" />gif
<input type="radio" name="file_type" id="file_exe" value="exe" onchange="fileOtherTextChange()" />exe
<input type="radio" name="file_type" id="file_zip" value="zip" onchange="fileOtherTextChange()" />zip
<input type="radio" name="file_type" id="file_mp4" value="mp4" onchange="fileOtherTextChange()" />mp4
<input type="radio" name="file_type" id="file_other" value="other" onchange="fileOtherTextChange()" />其他
<input type="text" class="input-medium search-query" style="width:60px" id="file_other_text" disabled />
</p>
<p>
永久链接:
<input type="text" style="width: 405px" id="skydrive_new" value="" onMouseOver="this.select()" />
<input type="button" value="复制" onclick="copyUrl2()" />
</p>
</body>
</html>