View difference between Paste ID: sC6duLjY and unAt6kEF
SHOW: | | - or go back to the newest paste.
1
#-*-coding: cp1251 -*-
2
import urllib2
3
import cookielib
4
5-
str = raw_input()
5+
inp = open("input.txt", "r")
6-
out=open("output.txt","w")
6+
7-
cookie = cookielib.CookieJar()  
7+
str = inp.readlines()
8-
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie)) 
8+
9-
urllib2.install_opener(opener) 
9+
for a in str:
10-
headers = {"User-Agent" : "Mozilla/4.0 (compatible; MSIE 5.5; WindowsNT)" } 
10+
    fname = a[:-1]
11-
site = urllib2.urlopen(str)
11+
    out=open("".join(fname[7:])+".txt", "w")
12
    cookie = cookielib.CookieJar()  
13
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie)) 
14-
out.write(site.read())
14+
    urllib2.install_opener(opener) 
15
    headers = {"User-Agent" : "Mozilla/4.0 (compatible; MSIE 5.5; WindowsNT)" } 
16
    site = urllib2.urlopen(a[:-1])
17
    out.write(site.read())
18
    out.close()
19
20
21
22