推广 热搜: 公司  快速  上海  中国    未来  企业  政策  教师  系统 

python抓取抖音热门视频_用于抓取抖音热门视频和音乐的API

   日期:2024-11-02     作者:xinet    caijiyuan   评论:0    移动:http://keair.bhha.com.cn/mobile/news/16.html
核心提示:注:项目已不可用...DouYinAPI of DouYin App for humans.Installationpip3 install douyinUsageHere is the sample code:

:项目已不可用...

python抓取抖音热门视频_用于抓取抖音热门视频和音乐的API

DouYin

API of DouYin App for humans.

Installation

pip3 install douyin

Usage

Here is the sample code:

import douyin

from douyin.structures import Topic, Music

# define file handler and specify folder

video_file_handler = douyin.handlers.VideoFileHandler(folder='https://blog.csdn.net/weixin_39933713/article/details/videos')

music_file_handler = douyin.handlers.MusicFileHandler(folder='https://blog.csdn.net/weixin_39933713/article/details/musics')

# define mongodb handler

mongo_handler = douyin.handlers.MongoHandler()

# define downloader

downloader = douyin.downloaders.VideoDownloader([mongo_handler, video_file_handler, music_file_handler])

for result in douyin.hot.trend():

for item in result.data:

# download videos of topic/music for 100 max per

downloader.download(item.videos(max=100))

then you can get:

Item >

...

0%| | 0/10 [00:00, ?it/s]

Processing 1-10 of files

....

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6580510322468064526.mp4

10%|████▌ | 1/10 [00:01<00:16, 1.84s/it]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6516746291806997763.mp4

20%|█████████▏ | 2/10 [00:01<00:10, 1.33s/it]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6600742831352974596.mp4

40%|██████████████████▍ | 4/10 [00:02<00:05, 1.03it/s]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6484393014599879950.mp4

50%|███████████████████████ | 5/10 [00:02<00:04, 1.15it/s]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6616517521098935565.mp4

60%|███████████████████████████▌ | 6/10 [00:03<00:03, 1.27it/s]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6479958542747962637.mp4

70%|████████████████████████████████▏ | 7/10 [00:03<00:01, 1.68it/s]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6472305134377372941.mp4

80%|████████████████████████████████████▊ | 8/10 [00:03<00:00, 2.05it/s]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6562690160868199693.mp4

90%|█████████████████████████████████████████▍ | 9/10 [00:04<00:00, 2.27it/s]

Downloaded file to https://blog.csdn.net/weixin_39933713/article/details/videos/6500385230921141518.mp4

100%|█████████████████████████████████████████████| 10/10 [00:04<00:00, 2.33it/s]

本文地址:http://keair.bhha.com.cn/news/16.html    康宝晨 http://keair.bhha.com.cn/ , 查看更多

特别提示:本信息由相关用户自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。

 
 
更多>同类最新资讯
0相关评论

文章列表
相关文章
最新动态
推荐图文
最新资讯
点击排行
网站首页  |  关于我们  |  联系方式  |  使用协议  |  版权隐私  |  网站地图  |  排名推广  |  广告服务  |  积分换礼  |  网站留言  |  RSS订阅  |  违规举报  |  粤ICP备2023022329号