Code Monkey home page Code Monkey logo

douyin_spider's Introduction

抖音爬虫

抓取抖音App的视频爬虫

环境

Python3

安装配置

首先,你需要安装并配置好Node.js环境,然后bash运行

$ git clone [email protected]: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,抖音加密接口未变,测试可行

douyin_spider's People

Contributors

erisyoung avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.