Daha öncelerden bu kodun içine alldebrid çerezini girerek direkt olarak çeviri yapıyoduk, geçen teaqara istemişti o zaman bir iki yerini düzenlemiştim, isteyen deneyebilir/kullanabilir. Varsa bir sorun söylersiniz, gerekli düzeltmeleri yapmaya çalışırız.
PHP Kod:
#-*-coding:utf8;-*-
#qpy:2
#qpy:console
from urlparse import urlparse
from urllib import quote_plus
import urllib2, time, sys, json
import platform
if platform.platform().startswith("Linux"):
import androidhelper
droid=androidhelper.Android()
pano=droid.getClipboard().result
else:
from Tkinter import *
import ttk
root=Tk()
root.title("Link Girin")
root.resizable(width=FALSE, height=FALSE)
pgen = 500
pyuks = 100
ekrangen = root.winfo_screenwidth()
x = (ekrangen - pgen) / 2
root.geometry("%dx%d+%d+%d"%(pgen, pyuks, x, 200))
def clp(event=None):
global pano
pano = entry.get()
root.destroy()
entry = Entry(root, width=80)
entry.pack(pady=15)
ttk.Style().configure("prk.TButton", padding=6, relief="flat", background="#EBE6E6", foreground="#347D2B", font=("DejaVuSans", 11, "bold"))
tara = ttk.Button(root, text="Tamam", style='prk.TButton', command=clp, width=22)
tara.pack()
entry.insert(0, root.clipboard_get())
root.bind("<Return>", clp)
mainloop()
clp = ''
br = 1024**2
def format_size(bytes):
if bytes >= br:
return '%.1f MB' % (bytes/float(br))
elif bytes >= 1024:
return '%.1f KB' % (bytes/1024.0)
else:
return '%i B' % bytes
a = 'uid=7efc59ebdb4e2d568jm4e'
hdrs = {'Cookie': a}
b = urllib2.urlopen('http://alldebrid.com/api.php?action=get_host').read()
exec('tbl = [' + b.replace('\n', '') + ']')
try:
tbl.remove('youtube.com')
except:
pass
#print tbl
try :
try :
clp2 = pano
except:
clp2 = raw_input("link panodan alinamadi, manuel gir: ")
if clp != clp2:
clp = clp2
if clp.startswith('http://') or clp.startswith('https://'):
clp = clp.replace('://m.', '://')
host = urlparse(clp)[1]
if host.startswith('www.'):
host = host[4:]
if host in tbl:
q = urllib2.Request('http://httpsfear.appspot.com/?httpsurl=' + quote_plus('http://www.alldebrid.com/service.php?link=%s&json=true&pw=' % quote_plus(clp)))
#q = urllib2.urlopen('http://httpsfear.appspot.com/?httpsurl=' + quote_plus('http://www.alldebrid.com/service.php?link=%s&json=true&pw=' % quote_plus(clp)), headers = hdrs).read()
q.add_header("Cookie", a)
q2 = json.loads(urllib2.urlopen(q).read())
#print repr(q2['error'])
if q2['error'] == '':
q2['link'] = q2['link'].replace(' ', '%20')
print 'Host: '+ q2['host'].upper()
print 'Link: ' + q2['link'],
print 'filesize' in q2 and '\nDosya boyutu: ' + format_size(float(q2['filesize'])) + '\n' or ''
if platform.platform().startswith("Linux"):
import androidhelper
droid=androidhelper.Android()
droid.setClipboard(q2['link'])
else:
from Tkinter import *
import ttk
root=Tk()
root.clipboard_clear()
root.clipboard_append(q2['link'])
print "Link panoya kopyalandi..."
else:
print "bir hata olustu..."
print q2['error']
except Exception, e:
print str(e)
pass
time.sleep(1)
Turbobit Premium Link Çeviri | Turbobit Link Generator | http://turbobit.qpython.club