摘要: 版本一(基于类视图APIView类) views.py: APIView是继承的Django View视图的。 serializers.py from rest_framework import serializers #导入序列 from .models import User #导入表 版本二( 阅读全文
posted @ 2018-10-31 19:15 lvye001 阅读(646) 评论(3) 推荐(4) 编辑
摘要: Linux系统安装ffmpeg & 升级ffmpeg 一、介绍 多媒体视频处理工具FFmpeg有非常强大的功能,包括视频采集功能、视频格式转换、视频抓图、给视频加水印等。由于最近要处理音视频格式转换问题,因此需要安装、升级ffmpeg,下面来记录一下踩坑过程。 二、安装 ffmpeg 1、下载并解压 阅读全文
posted @ 2024-04-10 16:18 lvye001 阅读(25) 评论(0) 推荐(0) 编辑
摘要: import os from imagededup.methods import PHash phasher = PHash() def process_file(img_path): # 生成图像目录中所有图像的二值hash编码 encodings = phasher.encode_images( 阅读全文
posted @ 2023-07-10 15:54 lvye001 阅读(130) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriver from selenium.webdriver import ChromeOptions from selenium.webdriver.common.keys import Keys from selenium.webdriver.su 阅读全文
posted @ 2023-03-17 17:09 lvye001 阅读(21) 评论(0) 推荐(0) 编辑
摘要: import cv2 import os videopath =r"1-1-2-1_fa_diantou+idle+idle_audio.mp4" pic_path = r'F:\2023_02_24\liu_hui\video_cv2\pic' def start_deal(): vc = cv2 阅读全文
posted @ 2023-03-17 17:07 lvye001 阅读(138) 评论(0) 推荐(0) 编辑
摘要: import os mp4_dir_path = r'F:\2023_02_21\du_zhan\转换视频\mp4' gp3_dir_path = r'F:\2023_02_21\du_zhan\转换视频\3gp' for f in os.listdir(mp4_dir_path): mp4_ful 阅读全文
posted @ 2023-02-27 09:40 lvye001 阅读(120) 评论(0) 推荐(0) 编辑
摘要: import requests import re import json import time from xlrd import open_workbook from xlutils.copy import copy class TianYanChaSpider(): def __init__( 阅读全文
posted @ 2022-09-16 08:58 lvye001 阅读(353) 评论(0) 推荐(0) 编辑
摘要: import os import requests from tqdm import tqdm VIDEO_PATH = r'videos' def download(url,fname): # 用流stream的方式获取url的数据 resp = requests.get(url, stream= 阅读全文
posted @ 2022-07-18 09:21 lvye001 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 首先 pip install yt-dlp import subprocessvideo_id = 'XHLaEfc3fTs'url = "https://www.youtube.com/watch?v=" + video_idsubprocess.call(['yt-dlp','-f','bv[e 阅读全文
posted @ 2022-06-24 19:28 lvye001 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 废话不多说,直接上代码 from selenium import webdriverfrom selenium.webdriver import ChromeOptionsimport timeimport refrom selenium.webdriver.support import expec 阅读全文
posted @ 2022-03-25 15:34 lvye001 阅读(3466) 评论(0) 推荐(1) 编辑
摘要: 反屏蔽 现在很多网站都加上了对 Selenium 的检测,来防止一些爬虫的恶意爬取。即如果检测到有人在使用 Selenium 打开浏览器,那就直接屏蔽。 其大多数情况下,检测基本原理是检测当前浏览器窗口下的 window.navigator 对象是否包含 webdriver 这个属性。因为在正常使用 阅读全文
posted @ 2022-03-25 10:43 lvye001 阅读(1230) 评论(0) 推荐(0) 编辑