nficano commited on
Commit
aaadb3c
·
1 Parent(s): e662902

updated readme

Browse files
Files changed (1) hide show
  1. README.rst +7 -54
README.rst CHANGED
@@ -16,10 +16,6 @@ pytube
16
 
17
  *pytube* is a lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos.
18
 
19
- A call for contributors
20
- =======================
21
- With pytube and `python-lambda <https://github.com/nficano/python-lambda/>`_ both continuing to gain momentum, I'm calling for contributors to help build out new features, review pull requests, fix bugs, and maintain overall code quality. If you're interested, please email me at nficano[at]gmail.com.
22
-
23
  Description
24
  ===========
25
 
@@ -46,25 +42,19 @@ Download using pip via pypi.
46
  Library usage
47
  =============
48
 
49
- .. code:: python
50
 
51
  >>> from pytube import YouTube
 
52
 
53
- >>> yt = YouTube("http://www.youtube.com/watch?v=9bZkp7q19f0")
54
-
55
- >>> # Once set, you can see all the codec and quality options YouTube has made
56
- >>> # available for the particular video by printing videos.
57
-
58
  >>> yt.streams.all()
59
  [<Stream: itag="22" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.64001F" acodec="mp4a.40.2">,
60
  <Stream: itag="43" mime_type="video/webm" res="360p" fps="30fps" vcodec="vp8.0" acodec="vorbis">,
61
  <Stream: itag="18" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.42001E" acodec="mp4a.40.2">,
62
  <Stream: itag="36" mime_type="video/3gpp" res="240p" fps="30fps" vcodec="mp4v.20.3" acodec="mp4a.40.2">,
63
- <Stream: itag="17" mime_type="video/3gpp" res="144p" fps="30fps" vcodec="mp4v.20.3" acodec="mp4a.40.2">]
64
-
65
- >>> # for dash streams
66
- >>> yt.dash_streams.all()
67
- [<Stream: itag="137" mime_type="video/mp4" res="1080p" fps="30fps" vcodec="avc1.640028">,
68
  <Stream: itag="248" mime_type="video/webm" res="1080p" fps="30fps" vcodec="vp9">,
69
  <Stream: itag="136" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.4d401f">,
70
  <Stream: itag="247" mime_type="video/webm" res="720p" fps="30fps" vcodec="vp9">,
@@ -82,45 +72,8 @@ Library usage
82
  <Stream: itag="250" mime_type="audio/webm" abr="70kbps" acodec="opus">,
83
  <Stream: itag="251" mime_type="audio/webm" abr="160kbps" acodec="opus">]
84
 
85
- >>> # You can also filter the criteria by filetype.
86
- >>> yt.dash_streams.filter(audio_codec='opus').all()
87
- [<Stream: itag="249" mime_type="audio/webm" abr="50kbps" acodec="opus">,
88
- <Stream: itag="250" mime_type="audio/webm" abr="70kbps" acodec="opus">,
89
- <Stream: itag="251" mime_type="audio/webm" abr="160kbps" acodec="opus">]
90
-
91
- >>> # Notice that the list is ordered by lowest resolution to highest. If you
92
- >>> # wanted the highest resolution available for a specific file type, you
93
- >>> # can do:
94
- >>> yt.dash_streams.first()
95
- <Stream: itag="137" mime_type="video/mp4" res="1080p" fps="30fps" vcodec="avc1.640028">
96
-
97
- >>> # You can also get all videos for a given resolution
98
- >>> yt.dash_streams.filter(resolution='720p').all()
99
- [<Stream: itag="136" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.4d401f">,
100
- <Stream: itag="247" mime_type="video/webm" res="720p" fps="30fps" vcodec="vp9">]
101
-
102
- >>> # To select a video by a specific itag you can use the get method.
103
- >>> yt.dash_streams.get(251)
104
- <Stream: itag="251" mime_type="audio/webm" abr="160kbps" acodec="opus">
105
-
106
- >>> # Okay, let's download it!
107
- >>> yt.dash_streams.get(251).download()
108
-
109
- Command-line usage
110
- ==================
111
-
112
- You can download a video by simply passing the ``--itag`` switch:
113
-
114
- .. code:: bash
115
-
116
- $ pytube http://www.youtube.com/watch?v=Ik-RsDGPI5Y --itag=22
117
-
118
-
119
- To list all available formats use the ``--list`` switch:
120
-
121
- .. code:: bash
122
-
123
- $ pytube http://www.youtube.com/watch?v=Ik-RsDGPI5Y
124
 
125
  Development
126
  ===========
 
16
 
17
  *pytube* is a lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos.
18
 
 
 
 
 
19
  Description
20
  ===========
21
 
 
42
  Library usage
43
  =============
44
 
45
+ .. code-block:: python
46
 
47
  >>> from pytube import YouTube
48
+ >>> yt = YouTube('http://www.youtube.com/watch?v=9bZkp7q19f0')
49
 
50
+ >>> # Let's show the available streams:
 
 
 
 
51
  >>> yt.streams.all()
52
  [<Stream: itag="22" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.64001F" acodec="mp4a.40.2">,
53
  <Stream: itag="43" mime_type="video/webm" res="360p" fps="30fps" vcodec="vp8.0" acodec="vorbis">,
54
  <Stream: itag="18" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.42001E" acodec="mp4a.40.2">,
55
  <Stream: itag="36" mime_type="video/3gpp" res="240p" fps="30fps" vcodec="mp4v.20.3" acodec="mp4a.40.2">,
56
+ <Stream: itag="17" mime_type="video/3gpp" res="144p" fps="30fps" vcodec="mp4v.20.3" acodec="mp4a.40.2">,
57
+ <Stream: itag="137" mime_type="video/mp4" res="1080p" fps="30fps" vcodec="avc1.640028">,
 
 
 
58
  <Stream: itag="248" mime_type="video/webm" res="1080p" fps="30fps" vcodec="vp9">,
59
  <Stream: itag="136" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.4d401f">,
60
  <Stream: itag="247" mime_type="video/webm" res="720p" fps="30fps" vcodec="vp9">,
 
72
  <Stream: itag="250" mime_type="audio/webm" abr="70kbps" acodec="opus">,
73
  <Stream: itag="251" mime_type="audio/webm" abr="160kbps" acodec="opus">]
74
 
75
+ >>> # neat. let's download this first one.
76
+ >>> yt.streams.first().download()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
  Development
79
  ===========