Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

Added optional parameters to STOP(), added a Logger, added a try/except around parse_args() to prevent a crash #52

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

DylanCa
Copy link

@DylanCa DylanCa commented Dec 31, 2021

Hi, I took the liberty to do a few modifications:

  1. Added optional parameters to the stop() method:
  • I am using this package with Django, and I need to be able to fully control the live without having to input anything manually, so I have added 3 parameters, which are save_to_igtv: bool = None, title = 'Live video', description = 'Live Instagram video.'. If save_to_igtv is not set, the behaviour stays the same. However, if it is set to either True or False, no input is required.
  1. Replaced print() methods with logger.info() methods:
  • To make the code more maintainable and reliable, I setup a basic logger and replaced the prints methods so us developers can know exactly what is happening and where.
  • I have added a couple logging in methods, such as start_broadcast() and stop_broadcast() to properly relate what is happening in real time.
  1. Added a try/except around parser.parse_args() in __init__() to prevent a SystemExit error to crash the app:
  • Because the parser tries to get args, when there are no arguments provided, it raises a SystemExit error which makes the whole app to crash.
  • This try/except is used only to catch the error and instead log what is happening then raises a non-fatal error.

I did my best to not modify but only improved what you did, and try to adapt the code to fit with my needs, which basically are 'be able to fully manage an instance of ItsAGramLive using Django & REST endpoints".

If you have any question or if you want me to change things, please do not hesitate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant