<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The YouTube API and Python</title>
	<atom:link href="http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/</link>
	<description>www.thinkhole.org</description>
	<lastBuildDate>Tue, 02 Feb 2010 16:30:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: YouTube API for Python &#187; Idea Critic</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-63586</link>
		<dc:creator>YouTube API for Python &#187; Idea Critic</dc:creator>
		<pubDate>Sat, 19 May 2007 10:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-63586</guid>
		<description>[...] I wanted to use the YouTube API a few weeks back for a project I&#8217;m working on, but after prowling around the Internet, I couldn&#8217;t find any Python library that implements it (something like flickr.py). So I wrote my own. [...]</description>
		<content:encoded><![CDATA[<p>[...] I wanted to use the YouTube API a few weeks back for a project I&#8217;m working on, but after prowling around the Internet, I couldn&#8217;t find any Python library that implements it (something like flickr.py). So I wrote my own. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Schwo.com</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-62625</link>
		<dc:creator>Schwo.com</dc:creator>
		<pubDate>Tue, 15 May 2007 02:09:14 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-62625</guid>
		<description>&lt;strong&gt;Undocumented YouTube API Method...&lt;/strong&gt;

I&#8217;m starting a project to remodel the video section on my blog to be more like the photos section.  I&#8217;d like to have albums of videos just as I have albums of photos.  The logical way to group videos with YouTube is by using playlists.  The...</description>
		<content:encoded><![CDATA[<p><strong>Undocumented YouTube API Method&#8230;</strong></p>
<p>I&#8217;m starting a project to remodel the video section on my blog to be more like the photos section.  I&#8217;d like to have albums of videos just as I have albums of photos.  The logical way to group videos with YouTube is by using playlists.  The&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Schwo.com</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-62621</link>
		<dc:creator>Schwo.com</dc:creator>
		<pubDate>Tue, 15 May 2007 01:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-62621</guid>
		<description>&lt;strong&gt;YouTube Kills TubePress++...&lt;/strong&gt;

Well, the success of my addition to TubePress was short lived.  Youtube, and some users, had a problem with the undocumented api call I found.  The call returned public and private playlists for any user.  Needless to say that was a problem YouTube had...</description>
		<content:encoded><![CDATA[<p><strong>YouTube Kills TubePress++&#8230;</strong></p>
<p>Well, the success of my addition to TubePress was short lived.  Youtube, and some users, had a problem with the undocumented api call I found.  The call returned public and private playlists for any user.  Needless to say that was a problem YouTube had&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: import this. &#187; Blog Archive &#187; Download videos from YouTube</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-23670</link>
		<dc:creator>import this. &#187; Blog Archive &#187; Download videos from YouTube</dc:creator>
		<pubDate>Fri, 05 Jan 2007 05:07:20 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-23670</guid>
		<description>[...] Related: YouTube API [...]</description>
		<content:encoded><![CDATA[<p>[...] Related: YouTube API [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reverse</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-18046</link>
		<dc:creator>reverse</dc:creator>
		<pubDate>Mon, 11 Dec 2006 20:03:31 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-18046</guid>
		<description>Hi gindc
I tried and tried but just can`t get the a properly indented to make it work, therefore I would appericiate a lot if you could send me a a properly indented version.


many thanks and regards
reverse</description>
		<content:encoded><![CDATA[<p>Hi gindc<br />
I tried and tried but just can`t get the a properly indented to make it work, therefore I would appericiate a lot if you could send me a a properly indented version.</p>
<p>many thanks and regards<br />
reverse</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reverse</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-17600</link>
		<dc:creator>reverse</dc:creator>
		<pubDate>Fri, 08 Dec 2006 17:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-17600</guid>
		<description>Hi gindc

I get following error!
&gt;C:\Python25\pythonw -u &quot;youtubeApi.py&quot;
  File &quot;youtubeApi.py&quot;, line 15
SyntaxError: Non-ASCII character &#039;\x92&#039; in file youtubeApi.py on line 15, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

I am quite a newbie to python....sorry for if it sounds dumb.</description>
		<content:encoded><![CDATA[<p>Hi gindc</p>
<p>I get following error!<br />
&gt;C:\Python25\pythonw -u &#8220;youtubeApi.py&#8221;<br />
  File &#8220;youtubeApi.py&#8221;, line 15<br />
SyntaxError: Non-ASCII character &#8216;\x92&#8242; in file youtubeApi.py on line 15, but no encoding declared; see <a href="http://www.python.org/peps/pep-0263.html" rel="nofollow">http://www.python.org/peps/pep-0263.html</a> for details</p>
<p>I am quite a newbie to python&#8230;.sorry for if it sounds dumb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stubbleblog</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-13174</link>
		<dc:creator>Stubbleblog</dc:creator>
		<pubDate>Wed, 08 Nov 2006 23:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-13174</guid>
		<description>&lt;strong&gt;YouTube API How-To...&lt;/strong&gt;

What is it The YouTube API lets you search for videos and display them on your site. For example, I use the API to pull videos tagged dance and display them on Rate My Dance Moves. The YouTube API is......</description>
		<content:encoded><![CDATA[<p><strong>YouTube API How-To&#8230;</strong></p>
<p>What is it The YouTube API lets you search for videos and display them on your site. For example, I use the API to pull videos tagged dance and display them on Rate My Dance Moves. The YouTube API is&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-9290</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sat, 23 Sep 2006 02:42:51 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-9290</guid>
		<description>I have created a very simple PHP class that handles a few of the key features of the wordpress API. 

You can find it at http://www.napolitopia.com/youtube_videos.php

Let me know what you think, or if you have any suggestions. 

-Sam</description>
		<content:encoded><![CDATA[<p>I have created a very simple PHP class that handles a few of the key features of the wordpress API. </p>
<p>You can find it at <a href="http://www.napolitopia.com/youtube_videos.php" rel="nofollow">http://www.napolitopia.com/youtube_videos.php</a></p>
<p>Let me know what you think, or if you have any suggestions. </p>
<p>-Sam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gindc</title>
		<link>http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/comment-page-1/#comment-5786</link>
		<dc:creator>gindc</dc:creator>
		<pubDate>Fri, 28 Jul 2006 17:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://thinkhole.org/wp/2006/01/09/the-youtube-api-and-python/#comment-5786</guid>
		<description>This program continuously plays youtube
videos using a python script and VLC.

Anyway, the program plays continues feeds from
youtube via os.system calls to VLC.

Just put the script in your VLC directory and run it.

Love the site, please keep up the free flow of info.

If it gets posted anywhere just put gindc.

Thanks again,

gindc

#!/usr/bin/python
#Load continues video from youtube.com.
#Requires videolan (VLC) media player (see http://www.videolan.org/)
#Just put this python script in your vlc.exe directory.
import urllib,sys
import os
from time import sleep
from string import find,replace
from htmllib import HTMLParser
from formatter import AbstractFormatter,DumbWriter
from cStringIO import StringIO
from random import shuffle

number_of_videos=30
startpage=&#039;http://www.youtube.com/categories_portal?c=23&amp;e=1&#039;

def readurl(url):
    try:
        f=urllib.urlopen(url)
        txt=f.read()
        f.close()
    except:
        txt=&#039;&#039;
    return txt

def FindLinks(html):

    tmp = StringIO()
    f = AbstractFormatter(DumbWriter(tmp))
    parser=HTMLParser(f)
    parser.feed(html)
    return parser.anchorlist

txt=readurl(startpage)
linklist=FindLinks(txt)
shuffle(linklist)
started=False
cnter=999
linklist2=[]
print &#039;loading link pages, please wait...&#039;
for startpage in linklist:
    if find(startpage,&#039;/watch&#039;)==-1 and number_of_videos&gt;len(linklist2):
        txt=readurl(&#039;http://www.youtube.com&#039;+startpage)
        ll=FindLinks(txt)
        for l in ll:
            if find(l,&#039;/watch&#039;)&gt;-1:
                if not l in linklist2:
                    linklist2.append(l)
    else:
        if not startpage in linklist2:
            linklist2.append(startpage)
shuffle(linklist2)
for startpage in linklist2:
        txt=readurl(&#039;http://www.youtube.com&#039;+startpage)
        spot=find(txt,&#039;new SWFObject&#039;)
        if spot&gt;-1:
            cnter+=1
            txt=txt[spot+37:]
            spot2=find(txt,&#039;&quot;&#039;)
            txt=txt[:spot2]
            video_id = txt[:]
            fname=&#039;test&#039;+str(cnter)+&#039;.flv&#039;
            print &#039;retrieving video::&#039;+str(cnter)

urllib.urlretrieve(&quot;http://www.youtube.com/get_video?video_id=&quot;+video_id,fna
me)
            if started:
                o.close()
            o=os.popen(&quot;vlc.exe &quot;+fname+&quot; -f vlc:quit&quot;)
            started=True</description>
		<content:encoded><![CDATA[<p>This program continuously plays youtube<br />
videos using a python script and VLC.</p>
<p>Anyway, the program plays continues feeds from<br />
youtube via os.system calls to VLC.</p>
<p>Just put the script in your VLC directory and run it.</p>
<p>Love the site, please keep up the free flow of info.</p>
<p>If it gets posted anywhere just put gindc.</p>
<p>Thanks again,</p>
<p>gindc</p>
<p>#!/usr/bin/python<br />
#Load continues video from youtube.com.<br />
#Requires videolan (VLC) media player (see <a href="http://www.videolan.org/)" rel="nofollow">http://www.videolan.org/)</a><br />
#Just put this python script in your vlc.exe directory.<br />
import urllib,sys<br />
import os<br />
from time import sleep<br />
from string import find,replace<br />
from htmllib import HTMLParser<br />
from formatter import AbstractFormatter,DumbWriter<br />
from cStringIO import StringIO<br />
from random import shuffle</p>
<p>number_of_videos=30<br />
startpage=&#8217;http://www.youtube.com/categories_portal?c=23&amp;e=1&#8242;</p>
<p>def readurl(url):<br />
    try:<br />
        f=urllib.urlopen(url)<br />
        txt=f.read()<br />
        f.close()<br />
    except:<br />
        txt=&#8221;<br />
    return txt</p>
<p>def FindLinks(html):</p>
<p>    tmp = StringIO()<br />
    f = AbstractFormatter(DumbWriter(tmp))<br />
    parser=HTMLParser(f)<br />
    parser.feed(html)<br />
    return parser.anchorlist</p>
<p>txt=readurl(startpage)<br />
linklist=FindLinks(txt)<br />
shuffle(linklist)<br />
started=False<br />
cnter=999<br />
linklist2=[]<br />
print &#8216;loading link pages, please wait&#8230;&#8217;<br />
for startpage in linklist:<br />
    if find(startpage,&#8217;/watch&#8217;)==-1 and number_of_videos&gt;len(linklist2):<br />
        txt=readurl(&#8216;http://www.youtube.com&#8217;+startpage)<br />
        ll=FindLinks(txt)<br />
        for l in ll:<br />
            if find(l,&#8217;/watch&#8217;)&gt;-1:<br />
                if not l in linklist2:<br />
                    linklist2.append(l)<br />
    else:<br />
        if not startpage in linklist2:<br />
            linklist2.append(startpage)<br />
shuffle(linklist2)<br />
for startpage in linklist2:<br />
        txt=readurl(&#8216;http://www.youtube.com&#8217;+startpage)<br />
        spot=find(txt,&#8217;new SWFObject&#8217;)<br />
        if spot&gt;-1:<br />
            cnter+=1<br />
            txt=txt[spot+37:]<br />
            spot2=find(txt,&#8217;&#8221;&#8216;)<br />
            txt=txt[:spot2]<br />
            video_id = txt[:]<br />
            fname=&#8217;test&#8217;+str(cnter)+&#8217;.flv&#8217;<br />
            print &#8216;retrieving video::&#8217;+str(cnter)</p>
<p>urllib.urlretrieve(&#8220;http://www.youtube.com/get_video?video_id=&#8221;+video_id,fna<br />
me)<br />
            if started:<br />
                o.close()<br />
            o=os.popen(&#8220;vlc.exe &#8220;+fname+&#8221; -f vlc:quit&#8221;)<br />
            started=True</p>
]]></content:encoded>
	</item>
</channel>
</rss>
