-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathindex.php
93 lines (91 loc) · 3.51 KB
/
index.php
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
90
91
92
93
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>BT种子转磁性链接 | 磁性链接转BT种子</title>
<meta name="description" content="Torrent to Magnet online converter">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/html5shiv.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/cdnjs/cdnjs/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link href="//cdn.jsdelivr.net/gh/cdnjs/cdnjs/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<link href="//cdn.jsdelivr.net/gh/cdnjs/cdnjs/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen" />
<link href="asset/base.css" rel="stylesheet" media="screen" />
<script src="asset/uploadify/jquery.uploadifive.min.js" type="text/javascript"></script>
<link href="asset/uploadify/uploadifive.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include('header.php');?>
<div id="body">
<div class="container">
<div id="container">
<div class="row">
<div class="span8 offset2">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#torrent2magnet" data-toggle="tab">种子转磁链</a></li>
<li><a href="#magnet2torrent" data-toggle="tab">磁链转种子</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="torrent2magnet">
<form>
<input id="file_upload" name="file_upload" type="file" multiple="false" />
<div id="queue"></div>
</form>
<div class="info"></div>
</div>
<div class="tab-pane" id="magnet2torrent">
<form class="form-search">
<input type="text" id="magnet" name="magnet" class="span6" placeholder="type magnet link here" />
<input type="button" class="btn btn-primary" id="submit" name="submit" value="submit" />
</form>
<div class="info"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include('footer.php');?>
<script type="text/javascript">
<?php $timestamp = time();?>
$(function() {
$('#file_upload').uploadifive({
'multi': false,
'formData' : {
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
'queueID' : 'queue',
'uploadScript' : 'torrent2magnet.php',
'onUploadComplete' : function(file, data, response) {
var result = $('#torrent2magnet .info');
var strhtml = 'The file ' + file.name + ' is vailed! ';
var obj = eval ("(" + data + ")");
if (obj.result)
{
strhtml = '<a href="' + obj.url + '" target="_blank">' + obj.url;
}
result.html('<div class="alert"><button type="button" class="close" data-dismiss="alert">×</button>' + strhtml + '</div>');
}
});
});
$(document).ready(function(){
$("#submit").click(function(){
var magneturl = $("#magnet")[0].value;
$.get("magnet2torrent.php", { magnet: encodeURIComponent(magneturl) },function(data){
var result = $('#magnet2torrent .info');
var obj = eval ("(" + data + ")");
var strhtml = 'The url ' + magneturl + ' is vailed! ';
if (obj.result) {
strhtml = '<a href="' + obj.url + '">' + obj.url;
}
result.html('<div class="alert"><button type="button" class="close" data-dismiss="alert">×</button>' + strhtml + '</div>');
});
});
});
</script>
</body>
</html>