One simple and easy to use crawler for DouYin
Project description
抖音爬虫
抓取抖音App的视频爬虫
环境
Python3
安装配置
首先,你需要安装并配置好Node.js环境,然后bash运行
$ git clone git@github.com:ErisYoung/douyin_spider.git
$ cd douyin_spider
$ pip install -r requirements.txt
使用方法
第一种方式:选择下载器和处理器,自行编写
你可以按如下方式使用:
from douyin_spider.downloaders.video import VideoDownloader
from douyin_spider.handler.video import VideoHandler
from douyin_spider.handler.music import MusicHandler
from douyin_spider.handler.mongodb import MongoHandler
from douyin_spider.enter.hot_top import hot_top20
video_handler = VideoHandler(folder='./videos')
music_handler = MusicHandler(folder='./musics')
mongo_handler = MongoHandler()
downloader = VideoDownloader([video_handler,music_handler,mongo_handler])
result = hot_top20()
for item in result.data:
downloader.download(item)
print("success")
💨注意:如果要使用mongo_handler,则需要提前启动mongodb
结果:
第二种方式:使用命令行参数
首先获取你所需要的share-url
然后把得到的url,输入命令行,默认下载10个视频
cd douyin_spider/tests
python assign_share_url.py -u "http://v.douyin.com/6Gf7FG/"
💨注意:这里要使用"",否则Windows环境下会出现error
更多的参数使用自行help查阅:
python assign_share_url.py --help
💨提示:有其他问题可以自行issue
更多的例子和入口
请看 tests
更多的下载器
请看 downloaders
更多的处理器
请看 handler
更新时间
2019-5-13: 👌处理_signature 签名参数,实测可行
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
douyin_spider-0.0.1.tar.gz
(16.2 kB
view hashes)
Built Distribution
Close
Hashes for douyin_spider-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 157c9e882b11c675c84b3640f66bc3af471a7f09ef83d8e0ae0d0051ad478e44 |
|
MD5 | bce0b126420c0d4c40b9d0cff682be6a |
|
BLAKE2b-256 | 9694780d5cbcda8bd586c4d22fc1a2c2d2133202f64decbb32c624504c697ce4 |