Skip to main content

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] [-t THREAD] [-e ENCODER] [--with-poster]

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'
  -t THREAD, --thread THREAD
                        threads num, use multi-threads to download info & images
  -e ENCODER, --encoder ENCODER
                        encoder of meta-data, 'nfo'(default) or 'vsmeta'
  --with-poster         save poster

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)
# videos: map { designatio -> [ slice_paths ] }

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 designatio, file_paths in videos.items():
    video = avutil.Video(designatio, file_paths)

    # Pull video info
    video.pull_info()

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

It's okey using BUS

    # Pull video info
    video.pull_info(source=avutil.Bus)

Save video info as .nfo file

    # 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"

Release files for avutil 1.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avutil 1.6.3
File Size Uploaded
avutil-1.6.3.tar.gz 25.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avutil 1.6.3
File Interpreter ABI Platform
avutil-1.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 54.4 kB

Release files / avutil-1.6.3.tar.gz

Download URL avutil-1.6.3.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
63813452675981f58bb29758df72020dae09a5fb79e0b8cc402dfd080edd3033
BLAKE2b-256 checksum
How to use checksums
4cffe75bbff7b13052399b2ba8786118f00abc25c6d8b31533bee73d99b5c364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.14

Release files / avutil-1.6.3-py3-none-any.whl

Download URL avutil-1.6.3-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2b0bf37273523306f2c12ed062a4289ed92b948c26d42270926caa7716da043
BLAKE2b-256 checksum
How to use checksums
5337c66ed2963c7084867f41798a51100ec59b7417e149d9c241b62ba32e564c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.14

Release history Release notifications | RSS feed

This release

1.6.3 This release

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page