Skip to content

Instantly share code, notes, and snippets.

@SahilC
Created June 7, 2013 21:00
Show Gist options
  • Save SahilC/5732388 to your computer and use it in GitHub Desktop.
Save SahilC/5732388 to your computer and use it in GitHub Desktop.
A simple python script to download Manga from MangaReader.
from urllib import request
print("Input Url to Manga on MangaReader")
x=input()
u=request.urlopen(x)
line=str(u.read(),encoding='utf8')
no=line.index("document['pu']")
no2=line.find(";",no)
print(no2-no)
url=line[no+17:no2]
url2=line[no+18:no2-12]
loop=int(url[-12:-5])
print(loop)
k=1
print(url2)
for i in range(loop,loop+100):
try:
u=request.urlopen(url2+str(i)+'.jpg')
f=open('naruto-'+str(k)+'.jpg','wb')
k+=1
f.write(u.read())
f.close()
if i-loop>30:
break
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment