FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/pythonchallenge/20.py at master · bjd1111/python · GitHub
bjd1111
python
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
pythonchallenge
/
20.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
82 lines (58 loc) · 1.57 KB
Breadcrumbs
python
/
pythonchallenge
/
20.py
Copy path
File metadata and controls
82 lines (58 loc) · 1.57 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
urllib
import
re
url
=
'http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg'
opener
=
urllib
.
URLopener
()
"""
opener.addheader('Range','bytes=30203-')
content = opener.open(url)
print content.info()
print content.read()
opener.addheader('Range','bytes=30237-')
content = opener.open(url)
print content.info()
print content.read()
opener.addheader('Range','bytes=30284-')
content = opener.open(url)
print content.info()
print content.read()
opener.addheader('Range','bytes=30295-')
content = opener.open(url)
print content.info()
print content.read()
opener.addheader('Range','bytes=30313-')
content = opener.open(url)
print content.info()
print content.read()
opener.addheader('Range','bytes=2123456789-')
content = opener.open(url)
print content.info()
print content.read()
opener.addheader('Range','bytes=2123456743-')
content = opener.open(url)
print content.info()
print content.read()
# the password is your new nickname in reverse。 (password: redavni)
opener.addheader('Range','bytes=1152983631-')
content = opener.open(url)
print content.info()
print content.read()
"""
opener
.
addheader
(
'Range'
,
'bytes=1152983631-'
)
content
=
opener
.
open
(
url
)
print
content
.
info
()
data
=
content
.
read
()
f
=
open
(
'20.zip'
,
'w'
)
f
.
write
(
data
)
f
.
close
()
"""
def data(byte):
bytes = 'bytes='+str(byte)+'-'
opener.addheader('Range',bytes)
content = opener.open(url)
print content.read()
length = re.findall(r'Content-Length: (.*)
\r
\n
Connection',str(content.info()),re.S)
return length[0]
byte = 30203
for i in xrange(10):
byte = data(byte)
"""
Back
|
FazBrowse Home
|
New Git URL