Created
October 17, 2017 15:42
-
-
Save yingziwu/ddbd708b1089aae23f9c26e037a0aafc to your computer and use it in GitHub Desktop.
v2ex node restricted detect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"qna", | |
"all4all", | |
"share", | |
"jobs", | |
"programmer", | |
"macos", | |
"create", | |
"python", | |
"flood", | |
"iphone", | |
"android", | |
"shadowsocks", | |
"apple", | |
"chamber", | |
"vps", | |
"pointless", | |
"linux", | |
"bb", | |
"cv", | |
"mbp", | |
"idev", | |
"career", | |
"in", | |
"v2ex", | |
"php", | |
"cloud", | |
"autistic", | |
"ideas", | |
"afterdark", | |
"dn", | |
"vpn", | |
"google", | |
"free", | |
"random", | |
"outsourcing", | |
"beijing", | |
"hardware", | |
"internet", | |
"js", | |
"flamewar", | |
"promotions", | |
"ios", | |
"gts", | |
"nodejs", | |
"java", | |
"dns", | |
"games", | |
"shanghai", | |
"babel", | |
"server", | |
"survey", | |
"music", | |
"newbie", | |
"feedback", | |
"fe", | |
"wechat", | |
"ipad", | |
"sandbox", | |
"webmaster", | |
"windows", | |
"bitcoin", | |
"chrome", | |
"design", | |
"movie", | |
"shenzhen", | |
"mysql", | |
"exchange", | |
"security", | |
"gae", | |
"nginx", | |
"monthly", | |
"wtf", | |
"hangzhou", | |
"fanfou", | |
"programming", | |
"life", | |
"linode", | |
"ssl", | |
"git", | |
"mechanical", | |
"router", | |
"openwrt", | |
"blog", | |
"tv", | |
"macbook", | |
"chengdu", | |
"accessory", | |
"guangzhou", | |
"vim", | |
"deals", | |
"c", | |
"designer", | |
"car", | |
"github", | |
"creditcard", | |
"steam", | |
"go", | |
"mba", | |
"docker", | |
"invest", | |
"wordpress", | |
"tuan", | |
"alipay", | |
"kindle", | |
"taste", | |
"closed", | |
"markdown", | |
"travel", | |
"ubuntu", | |
"coc", | |
"reading", | |
"diablo3", | |
"css", | |
"aws", | |
"surge", | |
"twitter", | |
"libido", | |
"photograph", | |
"ssd", | |
"cdn", | |
"django", | |
"nexus", | |
"sublime", | |
"db", | |
"xiaomi", | |
"2015", | |
"ps4", | |
"fit", | |
"soccer", | |
"igame", | |
"lol", | |
"imac", | |
"html", | |
"firefox", | |
"baby", | |
"mmm", | |
"tornado", | |
"atom", | |
"mongodb", | |
"software", | |
"swift", | |
"devops", | |
"acg", | |
"pi", | |
"dropbox", | |
"ror", | |
"appstore", | |
"browsers", | |
"pet", | |
"microsoft", | |
"typography", | |
"minecraft", | |
"redis", | |
"vue", | |
"ml", | |
"react", | |
"4g", | |
"coffee", | |
"tech", | |
"weibo", | |
"macmini", | |
"coding", | |
"jiong", | |
"sae", | |
"starter", | |
"bf3", | |
"evernote", | |
"sc2", | |
"gamedev", | |
"taobao", | |
"smartisanos", | |
"however", | |
"dota", | |
"beforesunrise", | |
"xcode", | |
"jetbrains", | |
"stormwind", | |
"flask", | |
"ripple", | |
"jquery", | |
"orca", | |
"dev", | |
"wuhan", | |
"telegram", | |
"lohas", | |
"jekyll", | |
"fir", | |
"http", | |
"watch", | |
"earphone", | |
"ps3", | |
"ruby", | |
"youtube", | |
"wow", | |
"api", | |
"business", | |
"leancloud", | |
"bike", | |
"dotnet", | |
"gossip", | |
"editors", | |
"inc", | |
"vagrant", | |
"kunming", | |
"ingress", | |
"diary", | |
"adsense", | |
"math", | |
"picky", | |
"love", | |
"blogger", | |
"emacs", | |
"alfred", | |
"hearthstone", | |
"pay", | |
"528491", | |
"en", | |
"opensource", | |
"icloud", | |
"nanjing", | |
"miui", | |
"seo", | |
"vscode", | |
"podcast", | |
"apache", | |
"arch", | |
"remodel", | |
"alphago", | |
"uber", | |
"ipod", | |
"facebook", | |
"hadoop", | |
"itunes", | |
"eve", | |
"re", | |
"zh2", | |
"overwatch", | |
"centos", | |
"safari", | |
"meteor", | |
"angularjs", | |
"photoshop", | |
"openstack", | |
"reprocess", | |
"wikipedia", | |
"meizu", | |
"ghost", | |
"bfbc2", | |
"paypal", | |
"btsync", | |
"u", | |
"xian", | |
"paper", | |
"gtd", | |
"arduino", | |
"macpro", | |
"feo", | |
"pm", | |
"xbox360", | |
"x", | |
"ssh", | |
"pokemon", | |
"jp", | |
"changsha", | |
"1990", | |
"global", | |
"jiankongbao", | |
"hexo", | |
"2017", | |
"show", | |
"zhihu", | |
"lifestyle", | |
"lego", | |
"offworld", | |
"tianjin", | |
"webos", | |
"elasticsearch", | |
"xiamen", | |
"fitness", | |
"livid", | |
"velocity", | |
"nvidia", | |
"instagram", | |
"sketch", | |
"algorithm", | |
"chongqing", | |
"3g", | |
"amazon", | |
"wwdc", | |
"running", | |
"postgresql", | |
"pronunciation", | |
"uniqlo", | |
"hongkong", | |
"puppet", | |
"smartisan", | |
"adobe", | |
"plant", | |
"gdg", | |
"icode", | |
"lua", | |
"dream", | |
"suzhou", | |
"5v5", | |
"drones", | |
"wp", | |
"gta", | |
"stripe", | |
"nokia", | |
"scifi", | |
"azure", | |
"naq", | |
"tmux", | |
"surface", | |
"qt", | |
"scala", | |
"edu", | |
"lamy", | |
"us", | |
"writing", | |
"ikea", | |
"visa", | |
"bash", | |
"imperfect", | |
"textmate", | |
"webrtc", | |
"nlp", | |
"xboxone", | |
"thinkpad", | |
"kotlin", | |
"blackberry", | |
"3ds", | |
"guide", | |
"freebsd", | |
"virtualbox", | |
"elinkvps", | |
"rustlang", | |
"opera", | |
"oracle", | |
"nba", | |
"treehole", | |
"flash", | |
"bf4", | |
"gitcafe", | |
"meet", | |
"nyc", | |
"dell", | |
"reddit", | |
"muji", | |
"simracing", | |
"imarketing", | |
"sony", | |
"gt", | |
"wilddog", | |
"nosql", | |
"animal", | |
"mobileme", | |
"path", | |
"fedora", | |
"switch", | |
"zhengzhou", | |
"draw", | |
"mushroom", | |
"haskell", | |
"sanfrancisco", | |
"gotye", | |
"pixel", | |
"kafka", | |
"otaku", | |
"dalian", | |
"inception", | |
"simcity", | |
"eggpain", | |
"lisp", | |
"skyrim", | |
"fitbit", | |
"openshift", | |
"heroku", | |
"2016", | |
"couchdb", | |
"bmw", | |
"qingdao", | |
"unity", | |
"mgs", | |
"iad", | |
"iwork", | |
"ifttt", | |
"appnet", | |
"cod", | |
"dust514", | |
"hos", | |
"soylent", | |
"nas", | |
"quora", | |
"gw2", | |
"psvita", | |
"vmware", | |
"iama", | |
"xehost", | |
"soho", | |
"notes", | |
"rime", | |
"zelda", | |
"erlang", | |
"riak", | |
"fuzhou", | |
"hishim", | |
"ted", | |
"tangcha", | |
"bong", | |
"depression", | |
"ffmpeg", | |
"gis", | |
"gitlab", | |
"olivida", | |
"wii", | |
"bicycle", | |
"dribbble", | |
"alexa", | |
"portal", | |
"varnish", | |
"smartos", | |
"line", | |
"status", | |
"firebase", | |
"vr", | |
"mactype", | |
"ohno", | |
"aden", | |
"duolingo", | |
"goban", | |
"udacity", | |
"pomodoro", | |
"4sq", | |
"la", | |
"guitar", | |
"ansible", | |
"mileage", | |
"udk", | |
"trello", | |
"california", | |
"laiwang", | |
"boinc", | |
"oneapm", | |
"psp", | |
"fml", | |
"london", | |
"jinan", | |
"ff", | |
"blackmagic", | |
"gentoo", | |
"bootstrap", | |
"wiiu", | |
"tesla", | |
"mobiledev", | |
"elixir", | |
"wireshark", | |
"daocloud", | |
"tensorflow", | |
"oauth", | |
"rework", | |
"ja", | |
"alienware", | |
"starbucks", | |
"svn", | |
"homebrew", | |
"cloudstack", | |
"rq", | |
"startupvisa", | |
"debian", | |
"immt", | |
"bose", | |
"ielts", | |
"ionic", | |
"touhou", | |
"civ", | |
"c9", | |
"asus", | |
"retro", | |
"vivaldi", | |
"ilife", | |
"search", | |
"mozilla", | |
"logitech", | |
"dotcloud", | |
"media", | |
"bigdata", | |
"atlassian", | |
"opensuse", | |
"ca", | |
"whv", | |
"outdoor", | |
"pgyer", | |
"cmb", | |
"webpack", | |
"jupyter", | |
"smarthome", | |
"gomoku", | |
"nike", | |
"pixelart", | |
"camino", | |
"moleskine", | |
"fcp", | |
"gap", | |
"curl", | |
"asana", | |
"amd", | |
"mercurial", | |
"nintendo", | |
"gopro", | |
"opengl", | |
"clojure", | |
"backbone", | |
"europe", | |
"uk", | |
"de", | |
"haproxy", | |
"stash", | |
"oculusvr", | |
"documentary", | |
"pingpp", | |
"cuda", | |
"obs", | |
"amp", | |
"serverless", | |
"caffe", | |
"perl", | |
"adidas", | |
"tengzhou", | |
"appletv", | |
"wuxi", | |
"xen", | |
"herher", | |
"whu", | |
"nfs", | |
"sqlite", | |
"stockholm", | |
"adwords", | |
"garageband", | |
"3dsmax", | |
"harbin", | |
"intel", | |
"os", | |
"razer", | |
"fling", | |
"video", | |
"0x10c", | |
"squid", | |
"spark", | |
"lvm", | |
"sports", | |
"dji", | |
"rethinkdb", | |
"synology", | |
"processing", | |
"wubi", | |
"keybase", | |
"pubg", | |
"tokyo", | |
"guiyang", | |
"moh", | |
"eco", | |
"iconfactory", | |
"harukimurakami", | |
"wired", | |
"admob", | |
"vcs", | |
"consoles", | |
"indesign", | |
"lighttpd", | |
"sqlalchemy", | |
"anno", | |
"tw", | |
"openresty", | |
"4k", | |
"bns", | |
"mint", | |
"forex", | |
"warcraft", | |
"coreos", | |
"ibeacon", | |
"samsung", | |
"twitch", | |
"cheap", | |
"caddy", | |
"bf1", | |
"gitbook", | |
"electron", | |
"nes", | |
"earth", | |
"gstar", | |
"vimeo", | |
"macau", | |
"ss", | |
"singapore", | |
"standardchartered", | |
"angel", | |
"asdf", | |
"cuttherope", | |
"killzone", | |
"instapaper", | |
"changchun", | |
"pixelmator", | |
"blender", | |
"starwars", | |
"moe", | |
"wacom", | |
"doitim", | |
"kde", | |
"ningbo", | |
"hbase", | |
"cisco", | |
"sv", | |
"olympics", | |
"chef", | |
"opennebula", | |
"unix", | |
"cn", | |
"glass", | |
"german", | |
"ie", | |
"titanfall", | |
"opencl", | |
"corvette", | |
"besiege", | |
"dashcam", | |
"edge", | |
"vive", | |
"rescuetime", | |
"huawei", | |
"ubnt", | |
"kk", | |
"guilin", | |
"bayarea", | |
"boardgame", | |
"taipei", | |
"zhuhai", | |
"ynsdfz", | |
"assembly", | |
"autocad", | |
"green", | |
"seattle", | |
"sydney", | |
"gamedevstory", | |
"standard", | |
"origin", | |
"yippeearts", | |
"ontology", | |
"nanchang", | |
"crysis", | |
"gcc", | |
"yc", | |
"computers", | |
"ea", | |
"rage", | |
"gnome", | |
"jinja", | |
"jlu", | |
"500px", | |
"air", | |
"homme", | |
"time", | |
"hawken", | |
"delphi", | |
"erp", | |
"xindanwei", | |
"irc", | |
"splunk", | |
"zfs", | |
"rst", | |
"discourse", | |
"dogma", | |
"rust", | |
"serf", | |
"powershell", | |
"shenyang", | |
"solar", | |
"log", | |
"syslog", | |
"destiny", | |
"webgl", | |
"barcelona", | |
"changes", | |
"tvos", | |
"rpgmaker", | |
"koukaku", | |
"khan", | |
"immigration", | |
"quip", | |
"pytest", | |
"logstash", | |
"converse", | |
"zh", | |
"newbalance", | |
"sanya", | |
"cocos2d", | |
"linkinpark", | |
"gyyz", | |
"bluray", | |
"rammstein", | |
"lanzhou", | |
"yangzhou", | |
"corsair", | |
"fengshui", | |
"24", | |
"stop", | |
"tsinghua", | |
"sysu", | |
"thebeatles", | |
"lotr", | |
"2012", | |
"hsbc", | |
"ubs", | |
"condenast", | |
"oslo", | |
"lbp", | |
"1q84", | |
"pal", | |
"cc", | |
"llvm", | |
"maya", | |
"bing", | |
"celery", | |
"wave", | |
"pinterest", | |
"asteroid", | |
"rabbitmq", | |
"ibook", | |
"galaxy", | |
"storm", | |
"downvoted", | |
"c3edge", | |
"iis", | |
"openvz", | |
"lucene", | |
"solr", | |
"stackoverflow", | |
"munin", | |
"sdn", | |
"confluence", | |
"sphinx", | |
"aerofs", | |
"sailfish", | |
"jira", | |
"salt", | |
"projects", | |
"webp", | |
"wagas", | |
"mbti", | |
"ace", | |
"hack", | |
"rfc", | |
"tarsnap", | |
"ssdb", | |
"bfh", | |
"drafts", | |
"waze", | |
"factorio", | |
"learn", | |
"polymer", | |
"excel", | |
"motorsport", | |
"monetdb", | |
"rog", | |
"ime", | |
"france", | |
"iot", | |
"wargaming", | |
"tamiya", | |
"lijiang", | |
"io", | |
"arcade", | |
"hohhot", | |
"daqing", | |
"80days", | |
"mapreduce", | |
"haikou", | |
"matrix", | |
"copter", | |
"moinmoin", | |
"pinkfloyd", | |
"u2", | |
"nirvana", | |
"kyoto", | |
"lacrimosa", | |
"tc", | |
"audi", | |
"paris", | |
"pku", | |
"sjtu", | |
"entropy", | |
"citi", | |
"energy", | |
"textie", | |
"portland", | |
"transformers", | |
"volkswagen", | |
"hm", | |
"muse", | |
"canon", | |
"nikon", | |
"bento", | |
"zakka", | |
"findpeople", | |
"xinyu", | |
"yueyang", | |
"dali", | |
"zunyi", | |
"xining", | |
"baoding", | |
"tongren", | |
"porsche", | |
"arc", | |
"frameworks", | |
"basic", | |
"cobra", | |
"chicago", | |
"scrum", | |
"monocle", | |
"3d", | |
"netbeans", | |
"whatsapp", | |
"illustrator", | |
"charles", | |
"zope", | |
"museum", | |
"ustc", | |
"techstars", | |
"aperture", | |
"gwan", | |
"openbsd", | |
"oreilly", | |
"memsql", | |
"couchbase", | |
"cassandra", | |
"computervision", | |
"passenger", | |
"chocolat", | |
"wesnoth", | |
"solaris", | |
"lasvegas", | |
"ceph", | |
"square", | |
"lxc", | |
"wiki", | |
"hubot", | |
"ts", | |
"kr", | |
"asia", | |
"fluentd", | |
"euca", | |
"hardcore", | |
"braun", | |
"core", | |
"itransfer", | |
"hyperloop", | |
"pdns", | |
"sap", | |
"borderlands", | |
"chevrolet", | |
"oversea", | |
"percona", | |
"kvm", | |
"sentry", | |
"boston", | |
"medium", | |
"servo", | |
"mb", | |
"dotgeek", | |
"wunderlist", | |
"shokunin", | |
"mesos", | |
"cement", | |
"bgp", | |
"iceland", | |
"cg", | |
"stingray", | |
"launchbar", | |
"otto", | |
"xcom", | |
"1984", | |
"hls", | |
"cardboard", | |
"hyper", | |
"monero", | |
"influxdb", | |
"daydream", | |
"kirby", | |
"hue", | |
"nds", | |
"re5", | |
"levis", | |
"bzr", | |
"berlin", | |
"digg", | |
"toruk", | |
"diesel", | |
"opensolaris", | |
"cray", | |
"ideology", | |
"inbox", | |
"gq", | |
"dubai", | |
"motion", | |
"toyota", | |
"abnamro", | |
"deutschebank", | |
"samsonite", | |
"dior", | |
"omega", | |
"ef", | |
"cartier", | |
"davidoff", | |
"leica", | |
"ec", | |
"loreal", | |
"lancome", | |
"fusionio", | |
"irobot", | |
"shade", | |
"lumix", | |
"directx", | |
"glassfish", | |
"zeppelin", | |
"coldfusion", | |
"pogo", | |
"femme", | |
"lightroom", | |
"se", | |
"mece", | |
"snort", | |
"rrdtool", | |
"xenserver", | |
"newrelic", | |
"make", | |
"edgecast", | |
"pasadena", | |
"santamonica", | |
"cherokee", | |
"ubersmith", | |
"netbsd", | |
"juniper", | |
"stunnel", | |
"plone", | |
"mx", | |
"re6", | |
"cloudera", | |
"voltdb", | |
"emc", | |
"mapr", | |
"zookeeper", | |
"dyn", | |
"diamondbar", | |
"rowlandheights", | |
"walnut", | |
"nissan", | |
"fdb", | |
"dart", | |
"hermanmiller", | |
"modo", | |
"lynda", | |
"mudbox", | |
"ouya", | |
"sputnik", | |
"solarcity", | |
"spacex", | |
"avocado", | |
"phabricator", | |
"ford", | |
"spg", | |
"airmech", | |
"smokeping", | |
"hubspot", | |
"catchpoint", | |
"ivalice", | |
"iray", | |
"mentalray", | |
"codemirror", | |
"metal", | |
"modsecurity", | |
"opentsdb", | |
"gcloud", | |
"mermaid", | |
"stats", | |
"snes", | |
"memcached", | |
"retroarch", | |
"algolia", | |
"amiibo", | |
"kyototycoon", | |
"igetget", | |
"racket", | |
"irvine", | |
"arkit", | |
"coreml", | |
"musickit", | |
"homepod", | |
"keras", | |
"torch", | |
"scikit", | |
"theano", | |
"msoffice", | |
"starcraft", | |
"kibana", | |
"csharp" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on Oct 2, 2017 | |
@author: arch | |
''' | |
cookies_file = 'v2ex_cookies.json' | |
reqs_headers = {'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36", | |
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', | |
'Accept-Language': 'zh', | |
'Connection':'keep-alive'} | |
import logging | |
logging.basicConfig(filename='v2ex.log',level=logging.INFO) | |
# prepare | |
import time | |
import requests | |
logging.info('\n') | |
logging.info('Start sign in on %s' % time.strftime('%Y-%m-%d %H:%M:%S')) | |
s = requests.session() | |
s.headers = reqs_headers | |
import os | |
import json | |
if os.path.exists(cookies_file) is True: | |
with open(cookies_file,'r') as f: | |
cookies = json.load(f) | |
s.cookies = requests.utils.cookiejar_from_dict(cookies) | |
else: | |
logging.error('Please create the cookies file on %s' % cookies_file) | |
exit(1) | |
# start sign in | |
import re | |
resp = s.get('https://www.v2ex.com/') | |
once = re.findall('once=(\d*)', resp.text) | |
if 'signout' not in resp.text: | |
logging.error('The cookies has expired.') | |
exit(2) | |
import json | |
import time | |
import random | |
with open('v2ex_node.json','r') as f: | |
v2ex_node = json.load(f) | |
base_url = 'https://www.v2ex.com/go/%s' | |
restricted_node = [] | |
for node in v2ex_node: | |
url = base_url % node | |
print('Test node %s' % node) | |
logging.info('Test node %s' % node) | |
time.sleep(3 * random.random()) | |
resp = s.get(url) | |
if resp.status_code == 403: | |
print('Banned!') | |
logging.error('Banned!') | |
break | |
if resp.url == 'https://www.v2ex.com/restricted': | |
print('The node %s is restricted.' % node) | |
logging.error('The node %s is restricted.' % node) | |
restricted_node.append(node) | |
with open(cookies_file,'w') as f: | |
json.dump(requests.utils.dict_from_cookiejar(s.cookies),f) | |
with open('restricted_noe.json','w') as f: | |
json.dump(restricted_node,f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment