File size: 1,329 Bytes
06297f7
 
 
 
 
 
 
fcb16f2
 
 
06297f7
 
 
fcb16f2
06297f7
 
 
 
 
 
 
fcb16f2
bf9119a
 
06297f7
fcb16f2
 
 
 
 
 
 
 
 
 
 
bf9119a
 
06297f7
fcb16f2
bf9119a
fcb16f2
 
bf9119a
 
fcb16f2
bf9119a
 
fcb16f2
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
python-youtube-downloader
=========================
Still needs a bit of cleaning up, and has a couple bugs, not bad for a
couple hours of hackin'. I should have them fixed quickly though. Enjoy!

TODO
----
1. Add a couple small features, like output path.
2. Write unit tests.
3. Add setup.py.

Installation
------------
1. Add it to your PYTHON PATH if you'd like, not much to her.

Usage example
-------------
::

    >>> from youtube import YouTube
    >>> yt = YouTube()
    >>> yt.url = "http://www.youtube.com/watch?v=Ik-RsDGPI5Y"

    >>> # View all encoding/quality options.
    >>> yt.videos
    [<Video: mp4 - 720p>,
    <Video: webm - 480p>,
    <Video: flv - 480p>,
    <Video: webm - 360p>,
    <Video: flv - 360p>,
    <Video: mp4 - 360p>,
    <Video: flv - 224p>]

    >>> #Set the filename, or get the default.
    >>> yt.filename
    'Pulp Fiction - Dancing Scene'

    >>> # Similar to the Django ORM, you can filter.
    >>> yt.filter('flv')
    [<Video: flv - 480p>, <Video: flv - 360p>, <Video: flv - 224p>]

    >>> yt.filter(res='480p')
    [<Video: webm - 480p>, <Video: flv - 480p>]

    >>> # You can even use get()
    >>> video = yt.get('mp4', '720p')

    >>> # Okay, let's download!
    >>> video.download()
    Downloading: Pulp Fiction - Dancing Scene.mp4 Bytes: 37561829
    37561829  [100.00%]