maitreyee19 commited on
Commit
0846ce6
·
unverified ·
1 Parent(s): b02aab4

Readme Update for #874 (#911)

Browse files

Updates readme to improve YouTube.on_progress() and Stream.download() documentation

Files changed (1) hide show
  1. README.md +8 -1
README.md CHANGED
@@ -228,12 +228,19 @@ If your application requires post-processing logic, pytube allows you to specify
228
  Similarly, if your application requires on-download progress logic, pytube exposes a callback for this as well:
229
 
230
  ```python
231
- >>> def show_progress_bar(stream, chunk, file_handle, bytes_remaining):
232
  return # do work
233
 
234
  >>> yt.register_on_progress_callback(show_progress_bar)
235
  ```
236
 
 
 
 
 
 
 
 
237
  ## Command-line interface
238
 
239
  pytube also ships with a tiny cli interface for downloading and probing videos.
 
228
  Similarly, if your application requires on-download progress logic, pytube exposes a callback for this as well:
229
 
230
  ```python
231
+ >>> def show_progress_bar(stream, chunk, bytes_remaining):
232
  return # do work
233
 
234
  >>> yt.register_on_progress_callback(show_progress_bar)
235
  ```
236
 
237
+ Download video(s) to specific directory with specific name
238
+
239
+ ```python
240
+ >>> yt = YouTube('https://youtube.com/watch?v=2lAe1cqCOXo')
241
+ >>> yt.streams.first().download(output_path="/tmp" ,filename='output')
242
+ ```
243
+
244
  ## Command-line interface
245
 
246
  pytube also ships with a tiny cli interface for downloading and probing videos.