• 大小: 26.76MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-28
  • 语言: Python
  • 标签:

资源简介

Python-下载指定用户的所有抖音视频以及收藏的视频无水印

资源截图

代码片段和文件信息

# -*- coding: utf-8 -*-
import sys
import re
import random
import time
from multiprocessing import Queue Pool
from PIL import Image

from douyin import CrawlerScheduler

if sys.version_info.major != 3:
    print(‘Please run under Python3‘)
    exit(1)
try:
    from common import debug config screenshot
    from common.auto_adb import auto_adb
    from common import apiutil
    from common.compression import crop_image
except Exception as ex:
    print(ex)
    print(‘请将脚本放在项目根目录中运行‘)
    print(‘请检查项目根目录中的 common 文件夹是否存在‘)
    exit(1)

VERSION = “0.0.1“

# 我申请的 Key,建议自己申请一个,共用容易请求过于频繁导致接口报错
# 申请地址 http://ai.qq.com
AppID = ‘2119053868‘
AppKey = ‘pYGDDlXzkEIwvPH1‘

DEBUG_SWITCH = True
FACE_PATH = ‘tmp/face/‘

adb = auto_adb()
adb.test_device()
config = config.open_accordant_config()

# 审美标准
BEAUTY_THRESHOLD = 85

# 最小年龄
GIRL_MIN_AGE = 15

# 识别性别: female male
GENDER = ‘female‘

# 进程数
PROCESS = 5

def yes_or_no():
    “““
    检查是否已经为启动程序做好了准备
    “““
    while True:
        yes_or_no = str(input(‘请确保手机打开了 ADB 并连接了电脑,‘
                              ‘然后打开手机软件,确定开始?[y/n]:‘))
        if yes_or_no == ‘y‘:
            break
        elif yes_or_no == ‘n‘:
            print(‘谢谢使用‘)
            exit(0)
        else:
            print(‘请重新输入‘)


def _random_bias(num):
    “““
    random bias
    :param num:
    :return:
    “““
    return random.randint(-num num)


def next_page():
    “““
    翻到下一页
    :return:
    “““

    time.sleep(1.5)
    cmd = ‘shell input swipe {x1} {y1} {x2} {y2} {duration}‘.format(
        x1=config[‘center_point‘][‘x‘]
        y1=config[‘center_point‘][‘y‘] + config[‘center_point‘][‘ry‘]
        x2=config[‘center_point‘][‘x‘]
        y2=config[‘center_point‘][‘y‘]
        duration=200
    )
    adb.run(cmd)


def follow_user():
    “““
    关注用户
    :return:
    “““
    cmd = ‘shell input tap {x} {y}‘.format(
        x=config[‘follow_bottom‘][‘x‘] + _random_bias(10)
        y=config[‘follow_bottom‘][‘y‘] + _random_bias(10)
    )
    adb.run(cmd)
    time.sleep(0.5)


def thumbs_up():
    “““
    点赞
    :return:
    “““
    cmd = ‘shell input tap {x} {y}‘.format(
        x=config[‘star_bottom‘][‘x‘] + _random_bias(10)
        y=config[‘star_bottom‘][‘y‘] + _random_bias(10)
    )
    adb.run(cmd)
    time.sleep(0.5)


def tap(x y):
    “““
    点击指定坐标位置

    :param x point
    :param y point
    :return 
    “““

    cmd = ‘shell input tap {x} {y}‘.format(
        x=x + _random_bias(10)
        y=y + _random_bias(10)
    )
    adb.run(cmd)


def share_video():
    “““点击分享视频按钮
    :return:
    “““

    cmd = ‘shell input tap {x} {y}‘.format(
        x=config[‘share_bottom‘][‘x‘] + _random_bias(10)
        y=config[‘share_bottom‘][‘y‘] + _random_bias(10)
    )
    adb.run(cmd)
    time.sleep(0.5)


def left_swipe():
    “““向左滑动获取分享视频链接按钮
    :return:
    “““

    # 多次滑动,确保能够正确得到按钮页面
    for _ in range(5):
        cmd = ‘shell input swipe {x1} {y1} {x2} {y2} {duration}‘.format(
            x1=config[‘left_swipe_point‘][‘x‘]
  

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-08-03 03:48  douyin_downloader-master\
     文件         180  2019-08-03 03:48  douyin_downloader-master\.gitignore
     文件         388  2019-08-03 03:48  douyin_downloader-master\CHANGELOG.md
     文件        1782  2019-08-03 03:48  douyin_downloader-master\DOWNLOAD.md
     文件        1065  2019-08-03 03:48  douyin_downloader-master\LICENSE
     文件        3230  2019-08-03 03:48  douyin_downloader-master\README.md
     目录           0  2019-08-03 03:48  douyin_downloader-master\Tools\
     文件       96256  2019-08-03 03:48  douyin_downloader-master\Tools\AdbWinApi.dll
     文件       60928  2019-08-03 03:48  douyin_downloader-master\Tools\AdbWinUsbApi.dll
     文件     1009664  2019-08-03 03:48  douyin_downloader-master\Tools\adb.exe
     文件      196608  2019-08-03 03:48  douyin_downloader-master\Tools\fastboot.exe
     目录           0  2019-08-03 03:48  douyin_downloader-master\apks\
     文件       10143  2019-08-03 03:48  douyin_downloader-master\apks\clipper.apk
     目录           0  2019-08-03 03:48  douyin_downloader-master\common\
     文件           0  2019-08-03 03:48  douyin_downloader-master\common\__init__.py
     文件        1869  2019-08-03 03:48  douyin_downloader-master\common\apiutil.py
     文件        2452  2019-08-03 03:48  douyin_downloader-master\common\auto_adb.py
     文件        1473  2019-08-03 03:48  douyin_downloader-master\common\compression.py
     文件        1405  2019-08-03 03:48  douyin_downloader-master\common\config.py
     文件        2760  2019-08-03 03:48  douyin_downloader-master\common\debug.py
     文件        1929  2019-08-03 03:48  douyin_downloader-master\common\screenshot.py
     目录           0  2019-08-03 03:48  douyin_downloader-master\config\
     目录           0  2019-08-03 03:48  douyin_downloader-master\config\1920x1080\
     文件         721  2019-08-03 03:48  douyin_downloader-master\config\1920x1080\config.json
     文件         721  2019-08-03 03:48  douyin_downloader-master\config\default.json
     目录           0  2019-08-03 03:48  douyin_downloader-master\data\
     文件          41  2019-08-03 03:48  douyin_downloader-master\data\README.md
     文件        7167  2019-08-03 03:48  douyin_downloader-master\douyin-bot.py
     文件     2580122  2019-08-03 03:48  douyin_downloader-master\douyin.png
     文件       16303  2019-08-03 03:48  douyin_downloader-master\douyin.py
     文件        1941  2019-08-03 03:48  douyin_downloader-master\local_file_adapter.py
............此处省略13个文件信息

评论

共有 条评论