Skip to content

Commit

Permalink
add option to download IGTV videos and timeout after 10 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Donearm committed Mar 15, 2020
1 parent 76013bb commit ffd5dbf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion instagram_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def argument_parser():
action="store_true",
help="update only previously downloaded profiles",
dest="update")
cli_parser.add_argument("-i", "--igtv",
action="store_true",
help="download IGTV videos too",
dest="igtvideos")
cli_parser.add_argument("action",
nargs="?",
default="run")
Expand Down Expand Up @@ -115,7 +119,7 @@ def main():
options = argument_parser()

# get instance
L = instaloader.Instaloader(download_videos=False, download_video_thumbnails=False, download_geotags=False, download_comments=False, save_metadata=False, post_metadata_txt_pattern="")
L = instaloader.Instaloader(download_videos=False, download_video_thumbnails=False, download_geotags=False, download_comments=False, save_metadata=False, post_metadata_txt_pattern="", request_timeout=10.0)
L.login('NNNNNNN', 'XXXXXXXX')

chdir(MAINPATH)
Expand All @@ -131,6 +135,9 @@ def main():

TODAY = datetime.today()

if options.igtvideos:
L.download_igtv(instaloader.Profile.from_username(L.context, options.action))

if options.action == "run":
massDownload(L, SINCEDATE, TODAY, "run")
elif options.action == "update":
Expand Down

0 comments on commit ffd5dbf

Please sign in to comment.