免费获取qq赞网站源码分享(qq赞领取网站)

大家好,关于免费获取qq赞网站源码分享很多朋友都还不太明白,不过没关系,因为今天小编就来为大家分享关于qq赞领取网站的知识点,相信应该可以解决大家的一些困惑和问题,如果碰巧可以解决您的问题,还望关注下本站哦,希望对各位有所帮助!

QQ空间自动点赞

前景提要目标确定分析介绍登陆获取cookie寻找XML寻找可变参数获取第一个空间动态寻找点赞所需的URL寻找可变参数功能提升到秒赞全部代码最后还是希望你们能给我点一波小小的关注。奉上自己诚挚的爱心

私信小编01即可获取大量Python学习资料

前景提要

因为我周围的小伙伴们天天跟我说的最多的一句话就是:空间第一条点赞。所以说我还不如直接做一个自动点赞的代码呢,免得天天催我点赞。

目标确定

QQ空间秒赞

分析介绍

登陆获取cookie

首先既然是对QQ空间的一系列操作,自然是先解决登陆方面,在这篇文章里面我就不过多介绍了,因为我上几期之前对QQ空间已经做了一定的介绍了。直接放出链接就好。欢迎看博主以前的文章

defsearch_cookie():\nqq_number=input(&39;)\nifnot__import__(&39;).path.exists(&39;):\nget_cookie_json(qq_number)\nwithopen(&39;,&39;)asf:\ncookie=json.load(f)\nreturnTrue\ndefget_cookie_json(qq_number):\npassword=__import__(&39;).getpass(&39;)\nfromseleniumimportwebdriver\nfromselenium.webdriver.chrome.optionsimportOptions\nlogin_url=&39;\nchrome_options=Options()\nchrome_options.add_argument(&39;)\ndriver=webdriver.Chrome(options=chrome_options)\ndriver.get(login_url)\ndriver.switch_to_frame(&39;)\ndriver.find_element_by_xpath(&34;switcher_plogin&39;).click()\ntime.sleep(1)\ndriver.find_element_by_xpath(&34;u&39;).send_keys(qq_number)\ndriver.find_element_by_xpath(&34;p&39;).send_keys(password)\ntime.sleep(1)\ndriver.find_element_by_xpath(&34;login_button&39;).click()\ntime.sleep(1)\ncookie_list=driver.get_cookies()\ncookie_dict={}\nforcookieincookie_list:\nif&39;incookieand&39;incookie:\ncookie_dict[cookie[&39;]]=cookie[&39;]\nwithopen(&39;,&39;)asf:\njson.dump(cookie_dict,f)\nreturnTrue\ndefget_g_tk():\np_skey=self.cookie[&39;]\nh=5381\nforiinp_skey:\nh+=(h<<5)+ord(i)\ng_tk=h&2147483647

寻找XML

当我们拿到cookie信息和g_tk这个参数之后,继续去寻找空间好友动态的XML在何处。首先点到XML位置一个个查找,发现有一个feeds3_html_more很像,点进去发现的确是我们要找的url链接。

寻找可变参数

这个链接所需要的参数有很多,在这里列举出来

uin:scope:view:daylist:uinlist:gid:flag:filter:applist:refresh:aisortEndTime:aisortOffset:getAisort:aisortBeginTime:pagenum:externparam:firstGetGroup:icServerTime:mixnocache:scene:begintime:count:dayspac:sidomain:useutf8:outputhtmlfeed:rd:usertime:windowId:g_tk:qzonetoken:g_tk:

这些参数中类似于可变参数的一共有五个。

qzonetokenwindowIdrdusertimeg_tkqzonetoken参数在源码中是个可变的“定值”,因为每次刷新这个参数都会变,但是源码中却给出了他的具体值。直接获取即可。

defget_space():\nyour_url=&39;+str(qq_number)\nhtml=requests.get(your_url,headers=headers,cookies=cookie)\nifhtml.status_code==200:\nqzonetoken=re.findall(&39;,html.text,re.S)[1].split(&34;&39;rd&39;0.9311604844249088&39;windowId&39;0.51158950324406&39;usertime&39;p_skey&例子\n34;{x:1,y:2,z:3}&34;{&39;:1,&39;:2,&39;:3}&39;{&34;:1,&34;:2,&34;:3}&{&39;:2,&39;:1,&39;:3}\ndata=demjson.decode(py_json1)\nprint(data)\n39;y&39;x&39;z&{&39;:2,&39;:1,&39;:3}

我们使用demjson直接将该字符串转换为耳熟能详的字典格式,提取其中的data的data,即为前八条动态的每个参数,但我们这里只要第一个说说的动态信息。

text=html.text[10:-2].replace(&34;,&34;).replace(&39;,&39;)\njson_list=demjson.decode(text)[&39;][&39;]\nqq_spaces=json_list[0]

我们拿到其信息后,先提取一些我们比较想知道的东西,比如名字、QQ号、发布时间、所获赞数、说说内容、说说地址等等结果。在qq_spaces参数中我们发现里面有一个很长也很特殊的一个结果是html结果,这个结果里面很长,简单来看是个网页常规代码,应该是被JavaScript写入到网页中了,既然不是全部代码,那么只能用正则提取一下里面的具体我们需要的东西了。

content=str(qq_spaces[&39;])\ntry:zanshu=re.findall(&34;f-like-cnt&39;,content,re.S)[0]\nexcept:returnNone\ntime_out=str(qq_spaces[&39;])\nprint(&34;+str(qq_spaces[&39;]))\nprint(&34;+str(qq_spaces[&39;]))\nprint(&34;+time_out)\nprint(&39;+zanshu)\ntimes=qq_spaces[&39;]\nhis_url=re.findall(&34;(.*?)&39;,content,re.S)[0]

寻找点赞所需的URL

在QQ空间随便找个好友点个赞吧,这样我们才能接收到请求。我们首先清空原来动态产生的抓包,直接点个赞发现关于dolike的url只有三个,第一个是个POST请求,应该是我们所需要的点赞网址。

寻找可变参数

我们获取到URL后,找到里面所需要的参数。发现一共有十一个参数,在这里猜测应该不存在加密参数。

qzreferrer参数为自己QQ空间的网址,表示从哪里来的链接地址。opuin参数为自己的QQ号,可以直接在代码提取。unikey参数与curkey参数为被点赞方的链接,即说说链接,刚才已获取。abstime参数为被点赞方说说的发布时间的时间戳。fid参数为被点赞方的链接后缀。

既然参数没什么问题那就直接写代码吧。

defget_zan(times,his_url):\ndata={&39;:g_tk,&39;:qzonetoken}\npost_data={\n&39;:&39;+str(qq_number),\n&39;:str(qq_number),\n&39;:str(his_url),\n&39;:str(his_url),\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:str(times),\n&39;:str(his_url).split(&39;)[-1],\n&39;:&39;,\n&39;:&39;\n}\nurl=&39;\nurl=url+urllib.parse.urlencode(data)\nhtml=requests.post(url,headers=headers,cookies=cookie,data=post_data)\nifhtml.status_code==200:print(&34;iflen(html.text)==469else&34;)

功能提升到秒赞

因为树莓派并不是很不错的问题,这个代码做不到绝对的秒赞。

在本地建立一个文件,负责写入最后一条说说所产生的时间戳。比对当前时间戳与空间第一条说说是否相同,若相同则无更新。点赞后重写文件,以便下次使用代码即可秒赞。

defrun_tolike():\nifos.path.exists(&39;):\nwithopen(&39;,&39;)asf:\ntime_out=f.read()\nelse:time_out=None\nwhileTrue:\nget_friends_list()\ntime.sleep(__import__(&39;).randint(0,5))39;说说无更新,等待中…&39;time_out.txt&39;w&39;%H:%M:%S&34;[&34;]&39;User-Agent&39;Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/63.0.3239.132Safari/537.36&39;time_out.txt&39;time_out.txt&39;r&39;random&39;cookie_dict.txt&39;cookie_dict.txt&39;r&39;getpass&39;请输入密码:&39;https://i.qq.com/&39;–headless&39;login_frame&39;//*[@id=&34;]&39;//*[@id=&34;]&39;//*[@id=&34;]&39;//*[@id=&34;]&39;name&39;value&39;name&39;value&39;cookie_dict.txt&39;w&39;p_skey&39;https://user.qzone.qq.com/&39;window.g_qzonetoken=(.*?);&39;&39;)[1]\nreturnTrue\ndefget_friends_list(self):\ntimes=&34;\nurl=&34;\ndata={\n&39;:self.qq_number,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:str(round(time.time()*1000)),\n&39;:&39;,\n&39;:self.g_tk,\n&39;:self.qzonetoken,\n}\nurl=url+urllib.parse.urlencode(data)+&39;+str(self.g_tk)\nhtml=requests.get(url,headers=self.headers,cookies=self.cookie)\nifhtml.status_code==200:\ntext=html.text[10:-2].replace(&34;,&34;).replace(&39;,&39;)\njson_list=demjson.decode(text)[&39;][&39;]\nqq_spaces=json_list[0]\ncontent=str(qq_spaces[&39;])\ntry:zanshu=re.findall(&34;f-like-cnt&39;,content,re.S)[0]\nexcept:returnNone\ntime_out=str(qq_spaces[&39;])\nlog(&34;+str(qq_spaces[&39;]))\nlog(&34;+str(qq_spaces[&39;]))\nlog(&34;+time_out)\nlog(&39;+zanshu)\ntimes=qq_spaces[&39;]\nhis_url=re.findall(&34;(.*?)&39;,content,re.S)[0]\nifnotself.time_outorself.time_out!=time_out:\nself.time_out=time_out\nself.get_zan(times,his_url)\nreturnTrue\nelse:log(&39;)\nelse:log(html.status_code)\ndefget_zan(self,times,his_url):\ndata={&39;:self.g_tk,&39;:self.qzonetoken}\npost_data={\n&39;:&39;+str(qq_number),\n&39;:str(qq_number),\n&39;:str(his_url),\n&39;:str(his_url),\n&39;:&39;,\n&39;:&39;,\n&39;:&39;,\n&39;:str(times),\n&39;:str(his_url).split(&39;)[-1],\n&39;:&39;,\n&39;:&39;\n}\nurl=&39;\nurl=url+urllib.parse.urlencode(data)\nhtml=requests.post(url,headers=self.headers,cookies=self.cookie,data=post_data)\nifhtml.status_code==200:log(&34;iflen(html.text)==469else&34;)\nwithopen(&39;,&39;)asf:\nf.write(str(times))\nif__name__==&34;:\nqq_number=input(&39;)\nQQ_like(qq_number)

好了,文章到这里就结束啦,如果本次分享的免费获取qq赞网站源码分享和qq赞领取网站问题对您有所帮助,还望关注下本站哦!

Published by

风君子

独自遨游何稽首 揭天掀地慰生平