Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
replace opencv with another tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Dec 4, 2023
1 parent 8b043f1 commit b20d09e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 123 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.0.23"
__version__ = "5.0.24"
14 changes: 6 additions & 8 deletions cyberdrop_dl/utils/sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from pathlib import Path
from typing import TYPE_CHECKING

import cv2
import mutagen
from videoprops import get_video_properties
from PIL import Image

from cyberdrop_dl.utils.utilities import FILE_FORMATS, purge_dir, log_with_color
Expand Down Expand Up @@ -123,14 +123,12 @@ async def sort_video(self, file: Path, base_name: str) -> None:
"""Sorts a video file into the sorted video folder"""
self.video_count += 1

cv2video = cv2.VideoCapture(str(file))
height = str(cv2video.get(cv2.CAP_PROP_FRAME_HEIGHT)).split('.')[0]
width = str(cv2video.get(cv2.CAP_PROP_FRAME_WIDTH)).split('.')[0]
props = get_video_properties(str(file))
height = str(props['height'])
width = str(props['width'])
resolution = f"{width}x{height}"
frames_per_sec = str(round(cv2video.get(cv2.CAP_PROP_FPS)))
codec = int(cv2video.get(cv2.CAP_PROP_FOURCC))
codec = chr(codec & 0xff) + chr((codec >> 8) & 0xff) + chr((codec >> 16) & 0xff) + chr((codec >> 24) & 0xff)
cv2video.release()
frames_per_sec = str(props['avg_frame_rate'])
codec = str(props['codec_name'])

parent_name = file.parent.name
filename, ext = file.stem, file.suffix
Expand Down
124 changes: 12 additions & 112 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
version = "5.0.23"
version = "5.0.24"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down Expand Up @@ -28,7 +28,7 @@ myjdapi = "^1.1.7"
mediafire = "^0.6.1"
mutagen = "^1.47.0"
pillow = "^10.1.0"
opencv-python = "^4.8.1.78"
get-video-properties = "^0.1.1"

[tool.poetry.scripts]
cyberdrop-dl = "cyberdrop_dl.main:main"
Expand Down

0 comments on commit b20d09e

Please sign in to comment.