<s> import sys <EOL> import re <EOL> import urllib2 <EOL> import traceback <EOL> import threading <EOL> import time <EOL> requests = '<STR_LIT>' ; urls_accessible_http = [ ] <EOL> def main ( ) : <EOL> list_of_requests = read_https_urls ( requests ) <EOL> urls_accessible_http = request_over_http ( list_of_requests ) <EOL> create_report ( urls_accessible_http ) <EOL> def create_report ( urls_accessible_http ) : <EOL> try : <EOL> f = open ( '<STR_LIT>' , '<STR_LIT:w>' ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> traceback . print_exc ( file = sys . stdout ) <EOL> if len ( urls_accessible_http ) > <NUM_LIT:0> : <EOL> for url in urls_accessible_http : <EOL> f . write ( url + '<STR_LIT:\n>' ) <EOL> else : <EOL> f . write ( '<STR_LIT>' ) <EOL> f . close ( ) <EOL> def read_https_urls ( requests ) : <EOL> list_of_requests = [ ] <EOL> try : <EOL> f = open ( requests , '<STR_LIT:r>' ) <EOL> except : <EOL> print '<STR_LIT>' <EOL> for url in f : <EOL> url = re . sub ( r'<STR_LIT>' , r'<STR_LIT:http>' , url ) <EOL> list_of_requests . append ( url ) <EOL> f . close ( ) <EOL> return list_of_requests <EOL> def request_over_http ( list_of_requests ) : <EOL> threads = [ ] <EOL> for url in list_of_requests : <EOL> url = re . sub ( r'<STR_LIT>' , r'<STR_LIT>' , url ) <EOL> url = re . sub ( r'<STR_LIT>' , r'<STR_LIT>' , url ) <EOL> print '<STR_LIT>' + url <EOL> try : <EOL> f = urllib2 . urlopen ( url ) <EOL> t1 = f . geturl ( ) . split ( '<STR_LIT::>' ) <EOL> if t1 [ <NUM_LIT:0> ] != '<STR_LIT>' : <EOL> urls_accessible_http . append ( url ) <EOL> except Exception : <EOL> pass <EOL> time . sleep ( <NUM_LIT:5> ) <EOL> return urls_accessible_http <EOL> main ( ) </s>
