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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file douyin_spider-0.0.2.tar.gz.

File metadata

  • Download URL: douyin_spider-0.0.2.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.0

File hashes

Hashes for douyin_spider-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a2b885aea70c9e512c7fe32e73a294a3837b3f24a845d7f8d2cf9c1faee0e6c3
MD5 0e05d47e5e2547121d8e0aeb96ca7dc6
BLAKE2b-256 0dc69924bf56e6b101ad18d4caf43370fd46b287fb57ecf5ed249afd97c0a25e

See more details on using hashes here.

File details

Details for the file douyin_spider-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: douyin_spider-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.0

File hashes

Hashes for douyin_spider-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74dca37a8761b1cdf8f6ac26b3d857f713afb34f7061088a35affbba9a72f508
MD5 d075d72e0f1ef9ebddd99a9989753ad9
BLAKE2b-256 508e69361e7c917750eeabeb5f52dc9fd32ab5f8808be0e6bc5f970eaf5e90dd

See more details on using hashes here.

Supported by

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