Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (39 sloc) 1.133 kb
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# binux<>
import os
import time
import urllib
import logging
from sys import argv
from libs import lixian_api, tools
from pprint import pprint
tid_dic = {}
if os.path.exists("tid.dict"):
for line in open("tid.dict", "r"):
line = line.strip()
size, tid = line.split(" ", 1)
tid_dic[int(size)] = tid
if len(argv) != 2:
print "usage:", __file__, "filepath"
cid = tools.cid_hash_file(argv[1])
gcid = tools.gcid_hash_file(argv[1])
size = os.path.getsize(argv[1])
fid = tools.gen_fid(cid, size, gcid)
fake_url = "" % (fid, tid_dic.get(size, 0))
print "cid: %s" % cid
print "gcid: %s" % gcid
print "size: %s" % size
print "fid: %s" % fid
print "fake_url: %s" % fake_url
print "thunder_url: %s" % tools.encode_thunder(fake_url)
lx = lixian_api.LiXianAPI()
print "checking file exist...",
ret = lx.webfilemail_url_analysis(fake_url)
if ret['result'] != 0:
print "no"
print "yes!"
Jump to Line
Something went wrong with that request. Please try again.