Skip to main content

Provide some useful util functions and a poweful tool (tidyup) for tidying up your video folder

Project description

avutil

Release

Provide some useful util functions (and a poweful tool tidyup) for tidying up your personal video folder. Data source from LIBRARY or BUS.

  • Extract designatio
  • Search folder (recursively)
  • Pull & save video info (title, actors etc.)
  • Download cover image
  • Rename video file

gjf

Environment

Python >= 3.4
BeautifulSoup4 >= 4.7.0
requests >= 2.21.0

Install

pip install avutil

Usage of tidyup

$ tidyup -h
usage: tidyup [-h] [-r] [-i IN] [-o OUT] [-p PROXY] [-s SOURCE]

Tidy up your personal video dir

optional arguments:
  -h, --help            show this help message and exit
  -r                    search dir recursively
  -i IN, --in IN        video input dir
  -o OUT, --out OUT     video output dir
  -p PROXY, --proxy PROXY
                        http proxy address
  -s SOURCE, --source SOURCE
                        data source of video info, 'library' or 'bus'

Tidy up current dir

$ tidyup

Python script usage

Import avutil:

import avutil

Search folder recursively to find videos:

folder = "StudyResource"
videos = avutil.Search_folder(folder)

Or you can specify the extension type of video

videos = avutil.Search_folder(folder, media_suffix={".mp4", ".wmv", ".avi", ".mkv"})

Pull video info from LIBRARY by default & download cover image

for video in videos:
    # Pull video info
    video.pull_info()

    # Download cover image (as video.title + .jpg)
    video.download_cover()

It's okey using BUS

for video in videos:
    # Pull video info
    video.pull_info(source=avutil.Bus)

Save video info as .nfo file

for video in videos:
    # Save video info
    video.save_info()

Tidy up!

    # Tidy up (rename to video.designatio + video.actors)
    video.rename()

Proxy

Proxy is supported in avutil in two ways, you can either pass http-proxy in code

video.pull_info(http_proxy="http://127.0.0.1:1087")
video.download_cover(http_proxy="http://127.0.0.1:1087")

Or define a global bash variable (eg. http proxy):

$ export HTTP_PROXY="http://127.0.0.1:1087"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avutil-1.3.2.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

avutil-1.3.2-py3-none-any.whl (21.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page