Skip to main content

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

或者

pip install douyin-spider

使用方法

第一种方式:选择下载器和处理器,自行编写

你可以按如下方式使用:

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

结果:

4.jpg 5.jpg 6.jpg 7.jpg

第二种方式:使用命令行参数

首先获取你所需要的share-url

然后把得到的url,输入命令行,默认下载10个视频

cd douyin_spider/douyin_spider
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 签名参数,实测可行
  • 2019-6-26: 👌打包上传至pypi,抖音加密接口未变,测试可行

Project details


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.2.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

douyin_spider-0.0.2-py3-none-any.whl (26.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page