Python API for YouTube
http://np1.github.io/pafy/
by nagev
Features:
---------
- Download any stream for a particular video
- Select best quality stream for download
- Retreive metadata such as viewcount, duration, rating, author, thumbnail, keywords
- Retrieve all availabe streams for a YouTube video (all resolutions and formats)
- Retrieve the Download URL to download or stream the video
- Small (< 150 lines of code) standalone, single importable module file.
- Works with age-restricted videos and non-embeddable videos
- No dependencies
Usage Examples:
---------------
Here is how to use the module in your own python code:
```python
>>> from pafy import Pafy
>>> url = "http://www.youtube.com/watch?v=dQw4w9WgXcQ"
# create a video instance
>>> video = Pafy(url)
# get certain attributes
>>> video.title
u'Rick Astley - Never Gonna Give You Up'
>>> video.rating
4.74645452989
>>> video.length
213
# display video metadata
>>> print video
Title: Rick Astley - Never Gonna Give You Up
Author: RickAstleyVEVO
ID: dQw4w9WgXcQ
Duration: 00:03:33
Rating: 4.74645452989
Views: 63307745
Thumbnail: https://i1.ytimg.com/vi/dQw4w9WgXcQ/default.jpg
Keywords: Rick, Astley, Sony, BMG, Music, UK, Pop
# show all formats for a video:
>>> streams = video.streams
>>> for s in streams:
>>> print s.resolution, s.extension
480x854 webm
480x854 flv
360x640 webm
360x640 flv
360x640 mp4
240x400 flv
320x240 3gp
144x176 3gp
http://np1.github.io/pafy/
by nagev
Features:
---------
- Download any stream for a particular video
- Select best quality stream for download
- Retreive metadata such as viewcount, duration, rating, author, thumbnail, keywords
- Retrieve all availabe streams for a YouTube video (all resolutions and formats)
- Retrieve the Download URL to download or stream the video
- Small (< 150 lines of code) standalone, single importable module file.
- Works with age-restricted videos and non-embeddable videos
- No dependencies
Usage Examples:
---------------
Here is how to use the module in your own python code:
```python
>>> from pafy import Pafy
>>> url = "http://www.youtube.com/watch?v=dQw4w9WgXcQ"
# create a video instance
>>> video = Pafy(url)
# get certain attributes
>>> video.title
u'Rick Astley - Never Gonna Give You Up'
>>> video.rating
4.74645452989
>>> video.length
213
# display video metadata
>>> print video
Title: Rick Astley - Never Gonna Give You Up
Author: RickAstleyVEVO
ID: dQw4w9WgXcQ
Duration: 00:03:33
Rating: 4.74645452989
Views: 63307745
Thumbnail: https://i1.ytimg.com/vi/dQw4w9WgXcQ/default.jpg
Keywords: Rick, Astley, Sony, BMG, Music, UK, Pop
# show all formats for a video:
>>> streams = video.streams
>>> for s in streams:
>>> print s.resolution, s.extension
480x854 webm
480x854 flv
360x640 webm
360x640 flv
360x640 mp4
240x400 flv
320x240 3gp
144x176 3gp
Metadata
Release files for pafy 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Pafy-0.1.tar.gz | 4.9 kB | Details |
Release files / Pafy-0.1.tar.gz
| Download URL | Pafy-0.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c82b167ef9d68fe784444281e5281fdeb61d910114259267b4a6974678249d9b
|
|
BLAKE2b-256 checksum How to use checksums |
06705a6792b3e0a0a371c7821b59fd5638849e3e568eb72b5e9819b2e90b1989
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |