Python 实现自动获取种子磁力链接
来源:互联网 发布:淘客发微博用什么软件 编辑:程序博客网 时间:2024/04/30 11:17
因为我闲来无事,所以准备找一部电影来看看。 然后我找到了种子搜索网站,可是这类网站的弹窗广告太多,搞得我很烦。所以我就想着自己用python写一个自动获取磁力链接的脚本。
整个大概写了半个小时。
代码如下
import requestsimport refrom bs4 import BeautifulSoup url="*种子的网站*/"header={ "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Encoding":"gzip, deflate", "Accept-Language":"zh-CN,zh;q=0.8", "Cache-Control":"max-age=0", "Connection":"keep-alive", "Content-Length":"65", "Content-Type":"application/x-www-form-urlencoded", "Host":"btkitty.bid", "Origin":"*种子的网站*", "Referer":"*种子的网站*/", "Upgrade-Insecure-Requests":"1", "User-Agent":"Mozilla/5.0 (Windows NT 10.0.14393; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2950.5 Safari/537.36" }while True: word=input("输入搜索关键词:") data={ "keyword":word, "hidden":"true" } res=requests.post(url,data=data,headers=header) bs=BeautifulSoup(res.text,"lxml") itemInfo=bs.find_all("dd",class_="option") torrent={} for item in itemInfo: magnet=item.find_next("a",href=re.compile("magnet.*")).attrs["href"] name=item.find_previous("a",href=re.compile("*种子的网站*/.*\.html")).text size=item.find_next(text=re.compile("\u6587\u4ef6\u5927\u5c0f")).find_next("b").text time=item.find_next(text=re.compile("\u6536\u5f55\u65f6\u95f4")).find_next("b").text hot=item.find_next(text=re.compile("\u4eba\u6c14")).find_next("b").text torrent[name]=[name,time,size,hot,magnet] for item in torrent: print("名称:",torrent[item][0]) print("发布时间:",torrent[item][1]) print("大小:",torrent[item][2]) print("热度:",torrent[item][3]) print("磁力链接:",torrent[item][4],'\n')
运行结果如下
0 0
- Python 实现自动获取种子磁力链接
- BT种子2磁力链接
- 详解什么是BT种子、迅雷下载链接、磁力链接
- Python+scrapy+mysql实现爬取磁力链接
- linux命令行下载BT种子和磁力链接
- 种子文件转成为磁力链接 下载BT磁力转换小工具
- 最新磁力种子库
- python爬虫下载网站磁力链接
- 磁力链接
- 磁力链接
- 【P2P网络】磁力链接转换为种子文件 magnet to torrent
- 【P2P网络】磁力链接转换为种子文件 magnet to torrent .
- 【归纳备忘】收集了一些神奇的BT种子磁力链接搜索网址
- 种子转磁力的方法
- 一个dht网络的“磁力链接”搜索python代码
- 一个dht网络的“磁力链接”搜索python代码
- 一个dht网络的“磁力链接”搜索python代码
- 一个dht网络的“磁力链接”搜索python代码
- Unity 按钮动态的绑定和触发方法
- falcon nodata 生成SQL脚本 不用一个个从后来添加
- ASP.NET MVC中Area的另一种用法
- css图片与图片之间总是会存在缝隙
- SpringMVC 3.1下返回json时中文显示乱码问题的解决方案
- Python 实现自动获取种子磁力链接
- Docker Engine 镜像源站
- Handler用法之简单实现轮播图
- 认识jQuery(三书)
- Linux试题1
- try-catch和throw,throws的区别和联系
- CodeMirror源码编辑器
- css中强制换行word-break、word-wrap、white-space区别实例说明
- iOS开发笔记