mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
3.2.9
This commit is contained in:
parent
9ce271561f
commit
55e6d2dbd5
@ -828,13 +828,11 @@ class Screencast(object):
|
|||||||
self.set(save_path, quality)
|
self.set(save_path, quality)
|
||||||
if self._path is None:
|
if self._path is None:
|
||||||
raise ValueError('save_path必须设置。')
|
raise ValueError('save_path必须设置。')
|
||||||
if not self._path.isascii():
|
|
||||||
raise TypeError('仅支持英文路径。')
|
|
||||||
clean_folder(self._path)
|
clean_folder(self._path)
|
||||||
self._page.driver.Page.screencastFrame = self._onScreencastFrame
|
self._page.driver.Page.screencastFrame = self._onScreencastFrame
|
||||||
self._page.run_cdp('Page.startScreencast', everyNthFrame=1, quality=self._quality)
|
self._page.run_cdp('Page.startScreencast', everyNthFrame=1, quality=self._quality)
|
||||||
|
|
||||||
def stop(self, to_mp4=True, video_name=None):
|
def stop(self, to_mp4=False, video_name=None):
|
||||||
"""停止录屏
|
"""停止录屏
|
||||||
:param to_mp4: 是否合并成MP4格式
|
:param to_mp4: 是否合并成MP4格式
|
||||||
:param video_name: 视频文件名,为None时以当前时间名命
|
:param video_name: 视频文件名,为None时以当前时间名命
|
||||||
@ -845,8 +843,8 @@ class Screencast(object):
|
|||||||
if not to_mp4:
|
if not to_mp4:
|
||||||
return str(Path(self._path).absolute())
|
return str(Path(self._path).absolute())
|
||||||
|
|
||||||
if not str(video_name).isascii():
|
if not str(video_name).isascii() or not str(self._path).isascii():
|
||||||
raise TypeError('仅支持英文文件名。')
|
raise TypeError('转换成视频仅支持英文路径和文件名。')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from cv2 import VideoWriter, imread
|
from cv2 import VideoWriter, imread
|
||||||
|
@ -205,7 +205,7 @@ class Screencast(object):
|
|||||||
|
|
||||||
def start(self, save_path: Union[str, Path] = None, quality: int = None) -> None: ...
|
def start(self, save_path: Union[str, Path] = None, quality: int = None) -> None: ...
|
||||||
|
|
||||||
def stop(self, to_mp4: bool = True, video_name: str = None) -> str: ...
|
def stop(self, to_mp4: bool = False, video_name: str = None) -> str: ...
|
||||||
|
|
||||||
def set(self, save_path: Union[str, Path] = None, quality: int = None) -> None: ...
|
def set(self, save_path: Union[str, Path] = None, quality: int = None) -> None: ...
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -6,7 +6,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="DrissionPage",
|
name="DrissionPage",
|
||||||
version="3.2.8",
|
version="3.2.9",
|
||||||
author="g1879",
|
author="g1879",
|
||||||
author_email="g1879@qq.com",
|
author_email="g1879@qq.com",
|
||||||
description="Python based web automation tool. It can control the browser and send and receive data packets.",
|
description="Python based web automation tool. It can control the browser and send and receive data packets.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user