/
dbg.py
37 lines (32 loc) · 941 Bytes
/
dbg.py
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
#!/usr/bin/python
# -*- coding: utf8 -*-
import os, sys, traceback
usr, psw = os.getenv('LOGIN', 'user:pass').split(':')
print usr, psw
dbg = True
porn = True
url = 'http://zamunda.net'
__resource__ = os.path.join( os.getcwd(), 'resources', 'lib' )
sys.path.insert(0, __resource__)
from zamunda import zamunda
if __name__ == '__main__':
if len(sys.argv) != 2:
sys.exit('wrong argument')
try:
z = zamunda(
xxx=True,
base_url=url,
usr=usr,
passwd=psw,
path=os.path.join(os.getcwd(), '', 'tmp'),
dbg=True)
for i in z.index():
print i
for r in z.page(0, '0', sys.argv[1]):
if r['path'] != 'next_page':
print r['info']['plot'].encode('utf8')
print z.get_magnet(r['path'])
except Exception, e:
traceback.print_exc()
print '%s, %s' % (str(e.args[0]), sys.exc_info())
pass