Skip to main content

Python module to access RedTube API

Project description

Python RedTube API Client


Here we go! I’d like to present simple module to access RedTube API. That API has a few

methods to access their video library with external clients (such as this small piece of code). Only read access is

provided at this moment.

So, I’ll show you one small example, how to use this cool library:

from redtube import RedClient



red = RedClient()

# Getting top of the top... I think so :)

collection = red.search()

# Search method provides list like object of type RedCollection with video entries of type RedVideo.

print type(collection)

# You can show you total videos for current search and current page

print collection.total, collection.page



# Let's search banana, it's good choice for this search engine

collection = red.search(query='banana', page=2)

# As you can see, we can access next page by page parameter

# Also you can access next page by calling next method from RedCollection instance

collection = red.next()



# You can access video entries by their internal ID

first = red.by_id('1')

# Or by some syntax sugar:

first = red[1]

print first # <RedVideo[1] "Heather taking it deep again">



# RedVideo entries has many useful information about video, ie:

print first.title, first.duration, first.url, first.player_url, first.embed

# As you can see, we can access video streaming url for this client or generate video embed code



# Also you can retrieve tag, category or star lists provided by RedTube

categories, tags, stars = red.categories, red.tags, red.stars

# This methods has internal cache, so you will do only one HTTP request for multi calls.

That’s all, guys! Have a nice day!

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

redtube-0.4.2.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file redtube-0.4.2.tar.gz.

File metadata

  • Download URL: redtube-0.4.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for redtube-0.4.2.tar.gz
Algorithm Hash digest
SHA256 4d6f935df6d133a86027f68bc15c555481296387c98549cac25022da37f4ef22
MD5 ab6527d933bebeaca7a3d7f46cae3dde
BLAKE2b-256 8137479261a10304dbd783089644e6b2963b643e354412f65865601221289334

See more details on using hashes here.

Supported by

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