YouTube video iframe generator
Project description
YT iframe Generator
yt_iframe is a python module which can convert a youtube video link into an embeddable iframe. In order to use this module, install it through your terminal.
foo@bar:~$ pip install yt-iframe
# Import statement
from yt_iframe import yt
Using the module
yt.video()
The video() function takes the youtube video link as a string argument. There are width and height optional arguments, so the size of the iframe can be specified. It returns the iframe as a string.
url = 'https://www.youtube.com/watch?v=UzIQOQGKeyI' # (Required)
width = '560' # (Optional)
height = '315' # (Optional)
iframe = yt.video(url, width=width, height=height)
yt.channel()
The channel() function takes a youtube channel link as a string argument. It returns a list of youtube video links.
url = 'https://www.youtube.com/user/ouramazingspace'
videolist = yt.channel(url)
yt.channelDict()
The channelDict() function takes a youtube channel link as a string argument. It returns a nested dictionary containing the name of the channel, and video titles.
url = 'https://www.youtube.com/user/ouramazingspace'
videolist = yt.channelDict(url)
videolist['name'] # Name of channel
videolist['videos'] # Nested dictionary. Key = video title, Value = link
yt.getFrames()
The getFrames() function takes a list of youtube videos as a list argument. There are framewidth and frameheight optional arguments, so the size of the iframes can be specified. It returns a list of iframes.
channel = yt.channel('https://www.youtube.com/user/ouramazingspace') # (Required)
framewidth = '560' # (Optional)
frameheight = '315' # (Optional)
iframes = yt.getFrames(channel, framewidth=framewidth, frameheight=frameheight)
Changelog
== v1.0.1 ==
- Allow size of iframe to be specified in video function
- Allow sizes of iframes to be specified in getFrames function
== v1.0.0 ==
- Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file yt_iframe-1.0.1.tar.gz
.
File metadata
- Download URL: yt_iframe-1.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe04fa5d91546ab1d8019bbb44d0f87a94835982d7e0b07c1518cba6a6524618 |
|
MD5 | aea31fcbdb7cc1567265a0347ba32c49 |
|
BLAKE2b-256 | a254ec84d74a0551d5c6e6b53ff315cb51c7c8c7481786b4ac444370b09d5d4a |