Skip to content

Commit

Permalink
fix..
Browse files Browse the repository at this point in the history
  • Loading branch information
Binux committed Mar 24, 2012
1 parent fbdc4c4 commit 00cc7ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions templates/lixian.html
Expand Up @@ -84,7 +84,7 @@
<div class="file-title">{{ file.title }}</div>
{% end %}
<div class="file-size">{{ format_size(file.size) }}</div>
<div class="file-2lixian task-button" style="display:none;"><a href="#" onclick="window.open(this.href); return false;"> 添加到我的离线 </a></div>
<div class="file-2lixian task-button" style="display:none;"><a onclick="window.open(this.href); return false;"> 添加到我的离线 </a></div>
<div class="clearfix"></div>
</li>
{% end %}
Expand Down Expand Up @@ -125,7 +125,6 @@

$(".file-item").hover(function() {
function url_fix(url, filename) {
console.log(url, filename);
var tid = url.match(/&tid=([^&]+)/)[1];
var fid = url.match(/fid=([^&]+)/)[1];
if (fid && tid)
Expand All @@ -135,7 +134,8 @@
var _this = $(this);
var t = _this.find("a.file-title");
if (t) {
_this.find(".file-2lixian a").attr("href", "http://lixian.vip.xunlei.com/lixian_login.html?furl="+encodeURIComponent(url_fix(t.attr("href"), t.text())));
if (!_this.find(".file-2lixian a").attr("href"))
_this.find(".file-2lixian a").attr("href", "http://lixian.vip.xunlei.com/lixian_login.html?furl="+encodeURIComponent(url_fix(t.attr("href"), t.text())));
_this.find(".file-2lixian").show()
}
}, function() {
Expand Down
6 changes: 3 additions & 3 deletions templates/share.html
Expand Up @@ -96,7 +96,7 @@
<div class="tname"><span class="p1">{{ len(file.title) > 15 and file.title[:-15] or file.title }}</span><span class="p2">{{ len(file.title) > 15 and file.title[-15:] or "" }}</span></div>
{% end %}
<div class="info"><span class="file-size">{{ format_size(file.size) }}</span></div>
<div class="add2lixian task-button" style="display:none;"><a href="#" onclick="window.open(this.href); return false;"> 添加到我的离线 </a></div>
<div class="add2lixian task-button" style="display:none;"><a onclick="window.open(this.href); return false;"> 添加到我的离线 </a></div>
<div class="clearfix"></div>
</li>
{% end %}
Expand Down Expand Up @@ -152,7 +152,6 @@

$(".file-item").hover(function() {
function url_fix(url, filename) {
console.log(url, filename);
var tid = url.match(/&tid=([^&]+)/)[1];
var fid = url.match(/fid=([^&]+)/)[1];
if (fid && tid)
Expand All @@ -162,7 +161,8 @@
var _this = $(this);
var t = _this.find("a.file-title");
if (t) {
_this.find(".add2lixian a").attr("href", "http://lixian.vip.xunlei.com/lixian_login.html?furl="+encodeURIComponent(url_fix(t.attr("href"), t.text())));
if(!_this.find(".file-2lixian a").attr("href"))
_this.find(".add2lixian a").attr("href", "http://lixian.vip.xunlei.com/lixian_login.html?furl="+encodeURIComponent(url_fix(t.attr("href"), t.text())));
_this.find(".add2lixian").show()
}
}, function() {
Expand Down
3 changes: 2 additions & 1 deletion upload_local_file.py
Expand Up @@ -26,7 +26,7 @@
gcid = tools.gcid_hash_file(argv[3])
size = os.path.getsize(argv[3])
fid = tools.gen_fid(cid, size, gcid)
fake_url = "http://sendfile.vip.xunlei.com/filename?fid=%s&mid=666&threshold=150&tid=%s" % (fid, tid_dic.get(size, 0))
fake_url = "http://dl1.c11.sendfile.vip.xunlei.com/download?fid=%s&mid=666&threshold=150&tid=%s" % (fid, tid_dic.get(size, 0))
print "cid: %s" % cid
print "gcid: %s" % gcid
print "size: %s" % size
Expand All @@ -47,6 +47,7 @@
exit()
else:
print "yes!"
fake_url = fake_url.replace("dl1.c11", "dl1.%s" % ret['msg']['section'].split("|")[0])
print "adding task to lixian..."
lx.task_check(fake_url)
lx.add_task_with_dict(fake_url, {
Expand Down

0 comments on commit 00cc7ae

Please sign in to comment.