Skip to main content

Library to download media files

Project description

Python Media Downloader

A very small and simple python package to download media files. This will save you some time if you need a downloader for webscraping or related project.

Requirements

  • Python 3.6+
  • Requests

Installation

pip install pmdownloader

Tested with:

  • Audio:
    • MP3
    • M4A
    • WAV
    • AAC
  • Video:
    • MP4
    • MKV
    • MOV
    • AVI
    • WEBM

Note: Not tested with large files

Usage

Default filename and filepath:

Call the function, and provide the URL of your media file.

import pmdownloader
url = 'https://i.imgur.com/pVzZERs.mp4'
print(pmdownloader.download(url))

Returns:

Downloaded: pVzZERs.mp4

Custom filename, Default filepath:

Call the function, and provide the URL, and filename.

import pmdownloader
url = 'https://i.imgur.com/pVzZERs.mp4'
print(pmdownloader.download(url, file_name='video.mp4'))

Returns:

Downloaded: video.mp4

Default filename, custom filepath:

Call the function, and provide the URL, and filename.

import pmdownloader
url = 'https://skyline.github.com/_nuxt/assets/sound/music-807dfe09ce23793891674eb022b38c1b.mp3'
print(pmdownloader.download(url, path='D:/saves/'))  # Use absolute path.

Returns:

Downloaded: music-807dfe09ce23793891674eb022b38c1b.mp3

Custom filename, custom filepath:

Call the function, and provide the URL, provide path and filename.

import pmdownloader
url = 'https://skyline.github.com/_nuxt/assets/sound/music-807dfe09ce23793891674eb022b38c1b.mp3'
print(pmdownloader.download(url, path='D:/saves/', file_name='audio.mp3'))  # Use absolute path.

Returns:

Downloaded: audio.mp3

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

pmdownloader-1.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

pmdownloader-1.0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pmdownloader-1.0.1.tar.gz.

File metadata

  • Download URL: pmdownloader-1.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for pmdownloader-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0ba4f159d6e662933f7ca77c060fa1ab1609f971377bcf2c6f2e83d82dc0d049
MD5 ec1348373bdd4c6c8aa156c754e90b43
BLAKE2b-256 ce0c10af81b0b720def02351f8dd473838fedf92d0c39e86edf4fa38f0ee6e51

See more details on using hashes here.

File details

Details for the file pmdownloader-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pmdownloader-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for pmdownloader-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb254c2e3452d29632d1d60b343ec601c698402f83731c1bd558e0f3129f36b2
MD5 cec3098c6da9c3ab3983938e06a1b327
BLAKE2b-256 98471eab08cf416edb40c74d63c62e5eeccb61775269e78f3fe827dbab788dec

See more details on using hashes here.

Supported by

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