Skip to main content

Introduction

copypl is a Python 3 script to copy the files referenced by a playlist (M3U, M3U8, or PLS) to a destination folder while retaining the folder structure of the original locations. By default, the playlist file is also copied; if the locations in the playlist are relative to the playlist, this means the copied playlist file will be correctly referencing the copied files.

Since this tool is intended for copying audio playlists, by default it will also copy JPEG and PNG files (cover art images, presumably) contained in the same folders that contain the files referenced by the playlist. An argument allows modification of additional file extensions to copy. Regardless of original intent, this tool should also work well with playlists containing video or other file types. However, for security and simplicity sake, it only works with local files contained within the folder containing the playlist file, or a subfolder.

A folder heirarchy is created in the destination folder relative to the playlist folder.

Usage

By default, copypl will copy the files referenced by a playlist, any JPEG and PNG files in referenced folders, and the playlist file itself to a destination folder:

copypl /share/Music/Favorites.m3u8 /mnt/sdcard

Or on Windows:

copypl C:\Music\Favorites.m3u8 D:\

The folders created at the destination mimic the folders relative to the source playlist file. For example, suppose the playlist in the first example above contained the following entries:

Popular/Releases/Heap, Imogen/Ellipse/113 - Half Life.ogg
/share/Music/Popular/Releases/Rush/2112/01 - 2112.ogg

Also suppose that the Ellipse and 2112 folders contained a cover.jpg file. The destination would like like so:

/mnt/sdcard/Favorites.m3u8
/mnt/sdcard/Popular/Releases/Heap, Imogen/Ellipse/113 - Half Life.ogg
/mnt/sdcard/Popular/Releases/Heap, Imogen/Ellipse/cover.jpg
/mnt/sdcard/Popular/Releases/Rush/2112/01 - 2112.ogg
/mnt/sdcard/Popular/Releases/Rush/2112/cover.jpg

The playlist file can be excluded from the copy using the --copy-playlist argument. Copy of related files can be controlled by the --extra-extension argument, but note that any argument passed will clear the defaults. Finally, by default, for efficiency, copypl will check modification timestamps of the source and destination files, and only overwrite older destination files. In addition, it will output a warning if an existing destination file is newer than the source file. Use the --ignore-mtime to always overwrite. Note that this may cause files to get copied multiple times, e.g., if the playlist references multiple files in a folder, then the extra files in the folder will get copied repeatedly.

Installation

Warning

Some Linux distributions discourage installation of system-level python packages using pip or setup.py install, due to collisions with the system package manager. In those cases, dependencies should be installed through the package manager, if possible, or choose a user folder installation method.

Installing with pip

If your system has pip installed, and you have access to install software in the system packages, then kantag kan be installed as administrator from PyPI:

# pip install copypl

If you do not have access to install system packages, or do not wish to install in the system location, it can be installed in a user folder:

$ pip install --user copypl

Installing from source

Either download a release tarball from the Releases page, and unpack:

$ tar zxvf copypl-1.0.0.tar.gz

Or get the latest source from the git repository:

$ git clone https://bitbucket.org/dgasaway/copypl

If you have access to install software in the system packages, then it can be installed as administrator:

# python setup.py install

If you do not have access to install system packages, or do not wish to install in the system location, it can be installed in a user folder:

$ python setup.py install --user

Metadata

Release files for copypl 1.0.1

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

Source distribution (sdist)

Source distribution for copypl 1.0.1
File Size Uploaded Provenance Actions
copypl-1.0.1.tar.gz 13.4 kB Without provenance Details for copypl-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 27.4 kB

Release files / copypl-1.0.1.tar.gz

Download URL copypl-1.0.1.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
82fe62e620990f8669ae22e67e9c6df6dd30ddb9f53de6b6b92a1cfec45d2263
BLAKE2b-256 checksum
How to use checksums
c240864ef365795d193461fff0ea96bce84efc1736f7213d33aee2b0a885b998
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.7.9

Release files / copypl-1.0.1-py3-none-any.whl

Download URL copypl-1.0.1-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0509833ad18335c86e79087477e8f47b3cc49134d909a71d08454690cdc95967
BLAKE2b-256 checksum
How to use checksums
68e33c5cbb0fc1a06095af0342497255ad499669c31367b2455cb576b99d93fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.7.9

Security for copypl 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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