当前位置: 首页 > news >正文

python 爬虫 入门 五、抓取图片、视频

目录

一、图片、音频

二、下载视频:


一、图片、音频

        抓取图片的手法在上一篇python 爬虫 入门 四、线程,进程,协程-CSDN博客里面其实有,就是文章中的图片部分,在那一篇文章,初始代码的28,29行,请求了图片。

img_response = requests.get(img_url) # 下载图片

img_stream = BytesIO(img_response.content)

        可以看出仅仅是将 之前获取文本、源代码的.text换为了.content。如果要保存,我们可以使用:

    with open("xxx.jpg", mode="wb") as f:  # jpeg/jpg/png/换请求到的格式f.write(resp.content)

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

        这就不赘述了,抓取音频也很像,这里拿Welcome to the Free Music Archive - Free Music Archive网站做个例子,虽然能直接按钮下载,但咱只学技术。

        打个比方,想下载这个网站的歌曲 但是下载要登录(我没登陆过,不确定登陆后能不能免费下),这个时候就该打开控制台了开始抓包了。通常来说,这种视频、音频的链接都不会开局就加载,而是会在你点击播放时,再向网页请求。

         如果你在网页直接输入这段长长的网址,就能当场播放这段音频,既然如此,我们直接用以下代码就能尝试下载(英语不好,听不懂在说啥。)https://files.freemusicarchive.org/storage-freemusicarchive-org/tracks/3VXD9eyhsZAUy5jjUWLgj3VGXR8ap7x54B6J6Paf.mp3

import requestsurl = "https://files.freemusicarchive.org/storage-freemusicarchive-org/tracks/3VXD9eyhsZAUy5jjUWLgj3VGXR8ap7x54B6J6Paf.mp3"
headers = {# 用户代理,某些网站验证用户代理,微微改一下,如果提示要验证码之类的,使用它"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome""/118.0.0.0 Safari/537.36",
}with requests.get(url=url, headers=headers,) as resp:resp.encoding = "utf-8"  # 当页面乱码改这里print(resp)with open("xxx.mp3", mode="wb") as f:  # 下载源码f.write(resp.content)

二、下载视频:

         下载视频的过程与图片和音频大不一样,较短的视频可以使用和上面相同的方法,但是长视频和视频播放网站用的时其他方法,比如https://www.pexels.com/zh-cn/video/3192166/这个网页中的视频就能用上述方法直接拿下,甚至给的就是下载链接。

        因为一段视频可能有几个G大小,用户又可能会拖动进度条。所以,视频通常会被“切片”,一般来说会1~2秒切做一片,通常最大不会超过20s。每个切片都是一个.ts文件,这些文件通过.m3u8文件组合起来,便是我们平常见的视频了。下面拿西游记做个演示:(其他网站差不多)《西游记86版》电视剧第1集完整版在线播放-星辰影院

基本上大部分网站视频都加密,不过问题不大,就是多一步解密而已 ,因此获取视频的步骤就是:

获取m3u8
根据m3u8获取所有ts
解密
组合所有ts,获得mp4

        开工之前,还有一件事,在目录建一个文件夹,并排除他,以作为ts临时目录,被排除的文件夹里面内容的更新不会引起PyCharm的更新。

 正式开工,编写代码:

import asyncio
import osimport aiofiles
import aiohttp
import requests
from Crypto.Cipher import AES  # 解密
from tqdm.asyncio import tqdm_asynciodef get_m3u8(url, headers):  # 获取m3u8中的所有ts链接m3u8_url = url + '/index.m3u8'with requests.get(url=m3u8_url, headers=headers, ) as resp:resp.encoding = "utf-8"  # 当页面乱码改这里m3u8_text = resp.textm3u8_text = m3u8_text.split("\n")  # 以回车分割m3u8_data = []for i in m3u8_text:  # 遍历m3u8,只找非#开头的ts链接,存到m3u8中if not (i.startswith('#') or i == ''):m3u8_data.append(i)return m3u8_datadef get_key(url, headers):  # 获取密钥key_url = url + '/enc.key'with requests.get(url=key_url, headers=headers, ) as resp:resp.encoding = "utf-8"  # 当页面乱码改这里key = resp.textreturn key.encode('utf-8')async def get_ts(url, name, headers, save_path, aes, ts_ok, num):async with aiohttp.ClientSession() as session:async with session.get(url=url, headers=headers)as resp:async with aiofiles.open(save_path + '/' + name, mode='wb')as f:await f.write(aes.decrypt(await resp.content.read()))  # 下载ts(顺道解密)ts_ok[num] = Trueasync def get_all_ts(urls, names, headers, path, ts_ok, key):  # 协程下载所有tsaes = AES.new(key=key, IV=b'0000000000000000', mode=AES.MODE_CBC)tasks = []for i in range(len(urls)):if not ts_ok[i]:  # 这个没下载呢,添加任务tasks.append(asyncio.create_task(get_ts(urls[i], names[i], headers, path, aes, ts_ok, i)))for done in tqdm_asyncio.as_completed(tasks):  # 带进度条的显示任务await donedef merge_ts(mp4_path, ts_path):  # 组合所有ts为mp4path = ts_path + '\\*.ts'# os.system(f"cat {path} > {mp4_path}")  # mac使用,其他操作系统查找别的合成ts文件方法os.system(f"copy /b {path} {mp4_path}")  # windows使用,其他操作系统查找别的合成ts文件方法# 该方法需求保存时,名字按字母排序if __name__ == "__main__":# 获取m3u8===================================================data_url = "https://hn.bfvvs.com/play/yb8lN7Wb"headers = {# 用户代理,某些网站验证用户代理,微微改一下,如果提示要验证码之类的,使用它"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome""/118.0.0.0 Safari/537.36",}save_path = "C:\\Users\\86135\\PycharmProjects\\pythonProject\\测试\\test"mp4_path = "video.mp4"m3u8 = get_m3u8(data_url, headers)# sava_names = [url_str.rsplit("/", 1)[-1] for url_str in m3u8]  # 获取按/从最右边分割一次后右边的字符串做文件名]sava_names = [f'{i:05d}.ts' for i in range(len(m3u8))]  # 为了合并,保存为00001~00265,以保证字母顺序不变enc_key = get_key(data_url, headers)all_ts_ok = [False] * len(m3u8)loop = asyncio.get_event_loop()loop.run_until_complete(get_all_ts(m3u8, sava_names, headers, save_path, all_ts_ok, enc_key))print(sum(all_ts_ok) / len(all_ts_ok))merge_ts(mp4_path, save_path)

 运行结果,不到半分钟,一段400+MB的视频就下来了。

100%|██████████| 266/266 [00:18<00:00, 14.67it/s]
1.0
C:\Users\86135\PycharmProjects\pythonProject\����\test\00000.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00001.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00002.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00003.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00004.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00005.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00006.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00007.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00008.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00009.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00010.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00011.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00012.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00013.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00014.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00015.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00016.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00017.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00018.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00019.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00020.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00021.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00022.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00023.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00024.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00025.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00026.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00027.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00028.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00029.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00030.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00031.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00032.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00033.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00034.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00035.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00036.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00037.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00038.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00039.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00040.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00041.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00042.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00043.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00044.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00045.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00046.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00047.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00048.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00049.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00050.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00051.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00052.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00053.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00054.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00055.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00056.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00057.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00058.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00059.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00060.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00061.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00062.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00063.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00064.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00065.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00066.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00067.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00068.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00069.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00070.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00071.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00072.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00073.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00074.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00075.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00076.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00077.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00078.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00079.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00080.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00081.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00082.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00083.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00084.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00085.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00086.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00087.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00088.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00089.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00090.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00091.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00092.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00093.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00094.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00095.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00096.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00097.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00098.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00099.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00100.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00101.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00102.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00103.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00104.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00105.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00106.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00107.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00108.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00109.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00110.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00111.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00112.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00113.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00114.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00115.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00116.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00117.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00118.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00119.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00120.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00121.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00122.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00123.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00124.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00125.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00126.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00127.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00128.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00129.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00130.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00131.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00132.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00133.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00134.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00135.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00136.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00137.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00138.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00139.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00140.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00141.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00142.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00143.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00144.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00145.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00146.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00147.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00148.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00149.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00150.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00151.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00152.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00153.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00154.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00155.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00156.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00157.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00158.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00159.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00160.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00161.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00162.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00163.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00164.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00165.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00166.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00167.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00168.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00169.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00170.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00171.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00172.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00173.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00174.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00175.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00176.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00177.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00178.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00179.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00180.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00181.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00182.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00183.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00184.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00185.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00186.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00187.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00188.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00189.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00190.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00191.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00192.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00193.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00194.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00195.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00196.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00197.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00198.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00199.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00200.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00201.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00202.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00203.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00204.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00205.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00206.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00207.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00208.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00209.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00210.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00211.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00212.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00213.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00214.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00215.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00216.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00217.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00218.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00219.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00220.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00221.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00222.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00223.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00224.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00225.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00226.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00227.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00228.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00229.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00230.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00231.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00232.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00233.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00234.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00235.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00236.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00237.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00238.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00239.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00240.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00241.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00242.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00243.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00244.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00245.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00246.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00247.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00248.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00249.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00250.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00251.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00252.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00253.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00254.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00255.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00256.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00257.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00258.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00259.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00260.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00261.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00262.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00263.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00264.ts
C:\Users\86135\PycharmProjects\pythonProject\����\test\00265.ts
�Ѹ���         1 ���ļ���

相关文章:

python 爬虫 入门 五、抓取图片、视频

目录 一、图片、音频 二、下载视频&#xff1a; 一、图片、音频 抓取图片的手法在上一篇python 爬虫 入门 四、线程&#xff0c;进程&#xff0c;协程-CSDN博客里面其实有&#xff0c;就是文章中的图片部分&#xff0c;在那一篇文章&#xff0c;初始代码的28&#xff0c;29行…...

ubantu 编译安装ceph 18.2.4

下载ceph代码 git clone https://github.com/ceph/ceph.git #切换tag git checkout v18.2.4 -b v18.2.4 #下载子模块 会有报错重新执行即可 git submodule update --init --recursive安装ceph所需要的依赖 #curl命令安装 sudo apt install curl#安装ceph依赖 ./install-deps.…...

哈希封装“unordered_set·map“

本文与对setmap的封装高度相似&#xff0c;可以参考我之前的对setmap封装的文章&#xff1a; 链接&#xff1a;&#xff08;没看过的话就点点我吧&#x1f61a;&#x1f61a;&#x1f61a;&#x1f61a;&#x1f61a;&#x1f61a;&#x1f61a;&#x1f61a;&#x1f61a;&am…...

Bi-LSTM-CRF实现中文命名实体识别工具(TensorFlow)

项目源码获取方式见文章末尾&#xff01; 回复暗号&#xff1a;13&#xff0c;免费获取600多个深度学习项目资料&#xff0c;快来加入社群一起学习吧。 **《------往期经典推荐------》**项目名称 1.【MobileNetV2实现实时口罩检测tensorflow】 2.【卫星图像道路检测DeepLabV3P…...

从JDK 17 到 JDK 21:Java 新特性

JDK17 密封类 概念&#xff1a;密封类允许开发者控制哪些类可以继承或实现特定的类或接口。通过这种方式&#xff0c;密封类为类的继承提供了更高的安全性和可维护性。 定义&#xff1a;使用sealed代表该类为密封类&#xff0c;并用permits限制哪些类可以继承。 public sea…...

【计算机网络 - 基础问题】每日 3 题(五十七)

✍个人博客&#xff1a;https://blog.csdn.net/Newin2020?typeblog &#x1f4e3;专栏地址&#xff1a;http://t.csdnimg.cn/fYaBd &#x1f4da;专栏简介&#xff1a;在这个专栏中&#xff0c;我将会分享 C 面试中常见的面试题给大家~ ❤️如果有收获的话&#xff0c;欢迎点赞…...

第十二章 章节练习created的应用

目录 一、引言 二、运行效果图 ​三、完整代码 一、引言 构建一个新闻的页面&#xff0c;页面在响应式数据准备好之后&#xff08;即created&#xff09;&#xff0c;就向后台接口请求获取新闻数据列表&#xff0c;然后赋值给Vue实例中的list列表&#xff0c;这个请求逻辑我…...

Unity 游戏性能优化实践:内存管理与帧率提升技巧

1. 引言 随着移动设备性能的逐步提升&#xff0c;游戏玩家对画质和流畅度的要求越来越高。优化 Unity 游戏性能不仅可以提升用户体验&#xff0c;还能降低设备的功耗&#xff0c;延长电池寿命。这篇文章将深入探讨如何在 Unity 中优化游戏的内存管理与帧率&#xff0c;通过多方…...

C++游戏开发详解

C 是一种广泛使用的编程语言&#xff0c;尤其在游戏开发领域有着不可替代的地位。它提供了对底层硬件的直接访问能力&#xff0c;允许开发者优化性能&#xff0c;这对于追求高帧率和低延迟的游戏来说至关重要。本文将详细介绍使用 C 进行游戏开发的基础知识和技术要点&#xff…...

三、大模型(LLMs)微调面

本文精心汇总了多家顶尖互联网公司在大模型基础知识考核中的核心考点&#xff0c;并针对这些考点提供了详尽的解答。并提供电子版本&#xff0c;见于文末百度云盘链接中&#xff0c;供读者查阅。 一、大模型微调 • 1 如果想要在某个模型基础上做全参数微调&#xff0c;究竟需要…...

Flutter升级与降级

升级 版本升级 // 升级到指定版本flutter upgrade 版本号// 升级到最新版本flutter upgrade 降级 1.需要先确定想要降级的版本号。 2.切换到系统安装Flutter的目录 3.在https://github.com/flutter/flutter&#xff0c;找到要回退的版本号对应的commit序号&#xff08;具…...

分布式并发场景的核心问题与解决方案

文章目录 分布式并发场景的核心问题与解决方案一、核心问题分析1. 分布式事务问题2. 数据一致性问题3. 并发控制问题4. 分布式锁失效问题 二、解决方案1. 分布式事务解决方案1.1 可靠消息最终一致性方案1.2 TCC方案实现 2. 缓存一致性解决方案2.1 延迟双删策略2.2 Canal方案 3.…...

D - Many Segments 2(ABC377)

题意&#xff1a;给定n和m&#xff0c;给定n个区间li&#xff0c;ri&#xff0c;求出满足区间lr不完全包含区间liri的个数 分析&#xff1a;用优先队列对区间r进行排序&#xff0c;i表示左区间&#xff0c;每次找到右区间加入即可。 代码&#xff1a; #include<bits/stdc…...

数组指针和指针数组的区别

数组指针和指针数组的区别 根据我个人的理解如下&#xff1a; 数组指针&#xff1a;指向数组的指针。着重点在于最后的指针两个字。 指针数组&#xff1a; 所有元素都是指针的数组。着重点在于最后的数组两个字。 另外来看助手的回答: Kimi: 1. **数组指针&#xff08;Ar…...

【VUE点击父组件按钮,跳转到子组件】

要实现在Vue中&#xff0c;父组件通过点击按钮进入子组件的 <el-dialog> 弹窗&#xff0c;并在弹窗中嵌套 <el-table> 表格&#xff0c;可以按照以下步骤进行编写代码&#xff1a; 在父组件中&#xff0c;定义一个数据属性用于控制子组件弹窗的显示与隐藏。 data…...

Java列表排序:方法与实践

在Java编程中&#xff0c;列表排序是一个常见且重要的任务。本文将介绍Java中对列表进行排序的几种方法&#xff0c;包括使用Collections.sort()、List.sort()以及自定义排序规则。 1. 使用Collections.sort() Collections.sort()是Java提供的一个静态方法&#xff0c;用于对…...

哈希及其封装实现unordermap和set

哈希 直接定址法 哈希和之前的红黑树的区别就是&#xff0c;它是通过映射关系来找到目标的&#xff0c;可以把它想象成之前排序的计数排序&#xff0c;那其实就是哈希的一种方法&#xff0c;叫做直接定址法。 对于比较集中的数据&#xff0c;它只需要开一段区间&#xff0c;…...

在 AMD GPU 上构建解码器 Transformer 模型

Building a decoder transformer model on AMD GPU(s) — ROCm Blogs 2024年3月12日 作者 Phillip Dang. 在这篇博客中&#xff0c;我们展示了如何使用 PyTorch 2.0 和 ROCm 在单个节点上的单个和多个 AMD GPU 上运行Andrej Karpathy’s beautiful PyTorch re-implementation …...

Canvas简历编辑器-选中绘制与拖拽多选交互设计

Canvas简历编辑器-选中绘制与拖拽多选交互设计 在之前我们聊了聊如何基于Canvas与基本事件组合实现了轻量级DOM&#xff0c;并且在此基础上实现了如何进行管理事件以及多层级渲染的能力设计。那么此时我们就依然在轻量级DOM的基础上&#xff0c;关注于实现选中绘制与拖拽多选交…...

简单工厂(Simple Factory)

简单工厂&#xff08;Simple Factory&#xff09; 在创建一个对象时不向客户暴露内部细节&#xff0c;并提供一个创建对象的通用接口。 说明&#xff1a; 简单工厂把实例化的操作单独放到一个类中&#xff0c;这个类就成为简单工厂类&#xff0c;让简单工厂类来决定应该用哪…...

ffmpeg拉流分段存储到文件-笔记

通过ffmpeg可以从rtsp网络流拉取数据并存储到本地文件里&#xff0c;如下命令。做个笔记 ffmpeg -rtsp_transport tcp -i rtsp://192.168.1.168:6880/live -c copy -f segment -segment_time 60 stream_piece_%d.mp4这条 ffmpeg 命令的作用是从一个 RTSP 流中捕获视频&#xff…...

Java 实习工资大概是多少?——解读影响薪资的因素

文章目录 1. 城市因素&#xff1a;一线、二线的差距2. 公司类型&#xff1a;互联网公司、外企和传统企业的差别3. 个人能力&#xff1a;经验、技术栈的重要性4. 其他影响因素&#xff1a;学历和实习时间总结推荐阅读文章 Java 开发作为广泛应用的职业方向&#xff0c;实习工资的…...

【Linux】万字详解:Linux文件系统与软硬链接

&#x1f308; 个人主页&#xff1a;Zfox_ &#x1f525; 系列专栏&#xff1a;Linux 目录 &#x1f680; 前言 一&#xff1a; &#x1f525; 磁盘的物理结构二&#xff1a; &#x1f525; 磁盘的存储结构 三&#xff1a; &#x1f525; 磁盘的逻辑结构 四&#xff1a; &#…...

spacenavd

介绍spacenavd开源项目&#xff0c;主要是因为在斯坦福大学的UMI项目中使用了该项目。在斯坦福大学的 UMI&#xff08;Universal Manipulation Interface&#xff09;项目中&#xff0c;Spacenavd 主要用于处理 3D Space Mouse&#xff08;空间鼠标&#xff09;的输入&#xf…...

C#WPF的XAML的语法详谈和特性

WPF的XAML&#xff08;eXtensible Application Markup Language&#xff09;是一种基于XML的标记语言&#xff0c;用于在.NET框架中定义和描述用户界面。XAML提供了一种声明性的方式来构建应用程序的UI元素&#xff0c;包括窗口、控件、布局、样式、动画和数据绑定等。 XAML的…...

一篇文章讲透数据结构之二叉搜索树

前言 在前面的学习过程中&#xff0c;我们已经学习了二叉树的相关知识。在这里我们再使用C来实现一些比较难的数据结构。 这篇文章用来实现二叉搜索树。 一.二叉搜索树 1.1二叉搜索树的定义 二叉搜索树&#xff08;Binary Search Tree&#xff09;是基于二叉树的一种升级版…...

新手入门c++(8)

到时候了&#xff0c;是时候给你们讲一下其他的定义形式与格式化输入输出了。 1.长整型变量 长整型变量分为两种&#xff1a; ①long类型 在计算机编程中&#xff0c;long 类型是一个整型数据类型&#xff0c;用于存储较大的整数。它的大小和范围取决于操作系统和编译器的实…...

新手铲屎官提问,有哪几款噪音低的宠物空气净化器推荐

相信很多铲屎官都明白的的痛就是猫咪掉毛太严重&#xff0c;所以每次看到满天飞的浮毛时只想赶紧逃离&#xff0c;一点都不想清理。但是家是自己的&#xff0c;猫是自己的&#xff0c;健康也是自己的&#xff0c;不清理也得清理。 为了更有效的清理浮毛&#xff0c;我朋友特意…...

解决RabbitMQ脑裂问题

文章目录 前言一、现象二、解决办法 前言 RabbitMQ脑裂 一、现象 RabbitMQ镜像群出现脑裂现象&#xff0c;各个节点的MQ实例都“各自为政”&#xff0c;数据并不同步。 二、解决办法 # 停止mq sh rabbitmq-server stop_app # 查看mq进程是否存在 ps -ef | grep rabbitmq # …...

经纬恒润AUTOSAR成功适配芯钛科技Alioth TTA8车规级芯片

在汽车电子领域&#xff0c;功能安全扮演着守护者的角色&#xff0c;它确保了车辆在复杂多变的情况下保持稳定可靠的运行。随着汽车电子的复杂性增加&#xff0c;市场对产品功能安全的要求也日益提高。基于此背景&#xff0c;经纬恒润AUTOSAR基础软件产品INTEWORK-EAS-CP成功适…...

加强网站建设管理 及时更新/百度网站排名查询工具

概述最近在监控发现某个数据库发生一个等待事件&#xff1a;enq: TX - index contention&#xff0c;报错截图如下&#xff1a;处理还是比较简单的&#xff0c;这里主要说一下enq: TX - index contention这个等待事件。enq: TX - index contentionenq:TX-index contention是一个…...

网站开发流程的认识/大数据分析师

问题描述见:http://www.iteye.com/problems/87448 Struts2里面的Action对象的result的String Print出来的结果没有问题 {"id":"4028efd439422d260139422d2a530000","name":"department"} 在Struts.xml里面配置的 <package name&quo…...

网站建设与栏目设置/小程序开发平台官网

1、模糊查询效率很低&#xff1a; 原因&#xff1a;like本身效率就比较低&#xff0c;应该尽量避免查询条件使用like&#xff1b;对于like %...%&#xff08;全模糊&#xff09;这样的条件&#xff0c;是无法使用索引的&#xff0c;全表扫描自然效率很低&#xff1b;另外&#…...

毕设 做网站/上海网站排名seo公司

Gallery组件主要用于横向显示图像列表&#xff0c;不过按常规做法。Gallery组件只能有限地显示指定的图像。也就是说&#xff0c;如果为Gallery组件指定了10张图像&#xff0c;那么当Gallery组件显示到第10张时&#xff0c;就不会再继续显示了。这虽然在大多数时候没有什么关系…...

nba东西部最新排名/宁波网站推广优化公司怎么样

//程序作者:管宁 //站点:www.cndev-lab.com //所有稿件均有版权,如要转载,请务必著名出处和作者 #include <iostream> using namespace std; class Vehicle { public: Vehicle(int weight 0) { Vehicle::weight weight; } void SetWeight(int we…...

自己电脑做服务器上传网站 需要备案吗/seo如何进行优化

转自&#xff1a;http://www.cnblogs.com/wrmfw/archive/2012/01/21/2328534.html 你发现快要过年了&#xff0c;于是想给你的女朋友买一件毛衣&#xff0c;你打开了www.taobao.com。这时你的浏览器首先查询DNS服务器&#xff0c;将 www.taobao.com转换成ip地址。不过首先你会发…...