Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install vecc

How to install vecc

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install vecc
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.6
0.8Never BuiltWhy not?
0.6 Available View build log
0.1 Available View build log
Windows (64-bit)
0.1
0.8Never BuiltWhy not?
0.1 Available View build log
Mac OS X (10.5+)
0.6
0.8Never BuiltWhy not?
0.6 Available View build log
0.1 Available View build log
Linux (32-bit)
0.8 Available View build log
0.7 Available View build log
0.6 Available View build log
0.1 Available View build log
Linux (64-bit)
0.8 Available View build log
0.7 Available View build log
0.6 Available View build log
0.1 Available View build log
0.8 Available View build log
 
License
BSD
Dependencies
Imports
Lastest release
version 0.8 on Apr 14th, 2013
Build Status

Cleans and updates your video's embed code.

Over time, the embed codes used for videos from various providers have changed and evolved, to make them more and more compatible with a broader set of devices.

This is where vecc is useful: it detects the video provider and id from a given embed code, and provides various utilities to clean this code and validate that the video is still available.

Install

Either use pip, which is the easiest way:

$ pip install vecc

Either download the tarball from http://pypi.python.org/pypi/vecc, untar it, and install it manually:

$ python setup.py install

Usage

$ vecc -h
usage: vecc [-h] [--version] {clean,validate} ...

Video Embed Code Cleaner.

optional arguments:
  -h, --help        show this help message and exit
  --version         show program's version number and exit

sub-commands:
  {clean,validate}
    clean           clean the embed code
    validate        validate that the video is still available

Sub-commands

  • clean: takes a video embed code, and returns the video id, provider, and new embed code. Takes an optional -v|--validate parameter, to check if the video is still available.
  • validate: takes a video id and provider, and check if it's still available.

Example

$ vecc clean '<object width="480" height="381"><param name="movie" value="http://www.dailymotion.com/swf/k6Lg9UXest3kho5p9X&related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/k6Lg9UXest3kho5p9X&related=0" type="application/x-shockwave-flash" width="480" height="381" allowFullScreen="true" allowScriptAccess="always"></embed></object>' -v
video id: k6Lg9UXest3kho5p9X
provider: dailymotion
embed code: <iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/k6Lg9UXest3kho5p9X"></iframe>
This video is still valid

Providers

Video providers (Google video, Youtube, Vimeo, Dailymotion...) are configured in the vecc/providers.py file.

Each provider configuration consists of:

  • name: youtube
  • link template: string template (that'll be interpolated with format) used to build the cleaned code. This is the link to the embedded video player. Needs the {video_id} tag.
  • embed template: string template used to build the new embed code. Needs the {video_link} tag.
  • validation template: string template used to build the link used to validate that the video is still available. This is the link to the video itself (as seen on the provider's website). Needs the {video_id} tag.
  • matches: regular expressions used to "match" a video embed code to a video provider. Must capture the video id.

Changelog

  • v0.8:
    • compatible python 2.6 to python 3.3
    • 100% test coverage
  • v0.7:
    • dropped allowfullscreen
    • added autoPlay=1&related=0 on video links
  • v0.6:
    • video size of the cleaned embed code is now 480x395
    • all embed codes with iframes use the same format with allowfullscreen="true", autoPlay="1", related="0"
  • v0.5:
    • compatibility with python2.6: argparse as a dependency
  • v0.4:
    • compatibility with python2.6: format needs field numbers

Subscribe to package updates

Last updated Apr 14th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.