Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instagram Video and IGTV downloader #3981

Merged
merged 9 commits into from
Nov 29, 2020
Merged

Conversation

Epic-R-R
Copy link
Contributor

Download Video and IGTV from Instagram

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

Download Video and IGTV from Instagram
@Epic-R-R Epic-R-R requested a review from cclauss as a code owner November 28, 2020 17:14
@ghost ghost added awaiting reviews This PR is ready to be reviewed require tests Tests [doctest/unittest/pytest] are required require type hints https://docs.python.org/3/library/typing.html labels Nov 28, 2020
@ghost
Copy link

ghost commented Nov 28, 2020

Pull Request Report

@Epic-R-R Hello! I'm a bot made to check all the pull request Python files. First of all, I want to say thank you for your time and interest in this project and for opening a pull request. There seems to be missing requirements in some of the Python files submitted in this pull request. Please read through the report and make the necessary changes. You can take a look at the relevant links provided after the report.

What are node paths? 🔽

The report contains headings and a checklist where the items are paths to the class/function/parameter where the requirement is missing. Node paths are double colon :: separated names and can be in any of the following format:

  • Class path: [file_name]::[class_name]
  • Function path: [file_name]::[function_name]
  • Function parameter path: [file_name]::[function_name]::[parameter_name]
  • Method path: [file_name]::[class_name]::[function_name]
  • Method parameter path: [file_name]::[class_name]::[function_name]::[parameter_name]

Following functions require tests [doctest/unittest/pytest]:

  • web_programming/instagram_video.py::get_video

Following function parameters require type hints:

  • web_programming/instagram_video.py::get_video::link
Relevant links 🔽

@ghost ghost removed the awaiting reviews This PR is ready to be reviewed label Nov 28, 2020
@ghost ghost added awaiting reviews This PR is ready to be reviewed and removed require tests Tests [doctest/unittest/pytest] are required require type hints https://docs.python.org/3/library/typing.html labels Nov 28, 2020
@ghost ghost added tests are failing Do not merge until tests pass awaiting reviews This PR is ready to be reviewed and removed awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass labels Nov 28, 2020
Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requests has json builtin.

The first thing that I would do after running this would be to rename the file to something relevant. Would there be a way to parse a more useful file name out of the user input?

@ghost ghost added awaiting changes A maintainer has requested changes to this PR and removed awaiting reviews This PR is ready to be reviewed labels Nov 28, 2020
@cclauss cclauss self-assigned this Nov 28, 2020
@dhruvmanila
Copy link
Member

FYI, I am not a big fan of the way this code is written just to fool the bot to remove the require ... labels. Also, if possible please write tests as the code could break in a matter of months depending on the API used. Take a look at how I wrote it for fetch_github_info: https://github.com/TheAlgorithms/Python/blob/master/web_programming/test_fetch_github_info.py

@amaank404
Copy link
Contributor

this is more of a command line tool, please implement the following things:

  • function is used to get the data (with doctests, and typehints)
  • no print or input function is used in function
  • file is returned through function and not saved
  • You can still have the input output (command line interface) in the if __name__ == "__main__" block

Copy link
Contributor

@amaank404 amaank404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the following changes first then you can add the doctests (or you can leave them because it is a downloading proggram and doctest might not be possible here)

@ghost ghost added require tests Tests [doctest/unittest/pytest] are required awaiting reviews This PR is ready to be reviewed and removed awaiting changes A maintainer has requested changes to this PR labels Nov 29, 2020
@ghost ghost added tests are failing Do not merge until tests pass and removed awaiting reviews This PR is ready to be reviewed labels Nov 29, 2020
@Epic-R-R
Copy link
Contributor Author

I Update the code but in pre-commit, I have some error in the download_video function.
I use isort and black on code and it's ok

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dhruvmanila
Copy link
Member

So, no tests?

@ghost ghost removed the tests are failing Do not merge until tests pass label Nov 29, 2020
@Epic-R-R
Copy link
Contributor Author

Great, thank you for Update the code

@cclauss cclauss merged commit 52a6213 into TheAlgorithms:master Nov 29, 2020
@amaank404
Copy link
Contributor

Wow, the code lines shrank too much 😄

@cclauss
Copy link
Member

cclauss commented Nov 29, 2020

;-). That’s what I do... https://github.com/cclauss/Ten-lines-or-less

@dhruvmanila
Copy link
Member

Explicit is better than implicit. 😉

@cclauss
Copy link
Member

cclauss commented Nov 29, 2020

What is implicit in this code?

@dhruvmanila
Copy link
Member

Nothing, just putting this line out there :)

@cclauss
Copy link
Member

cclauss commented Nov 29, 2020

@cclauss
Copy link
Member

cclauss commented Nov 29, 2020

So, no tests?

As I wrote you before, web programming tests are difficult to write without mocking so that basically makes doctests a nonstarter. If someone would be willing to add tests to this or another web programming algorithm, then we could use that as a guide for future web programming contributors.

@dhruvmanila
Copy link
Member

I will try to do that. In the meantime, if possible can you give a small glance to #3977 just to determine whether it's worth doing?

Also, I am in the middle of redesigning the parser for the bot and it will do more than just a comment. :)

stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Instagram Video and IGTV downloader 

Download Video and IGTV from Instagram

* Update

* Update

* Some Change

* Update

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
peRFectBeliever pushed a commit to peRFectBeliever/Python that referenced this pull request Apr 1, 2021
* Instagram Video and IGTV downloader 

Download Video and IGTV from Instagram

* Update

* Update

* Some Change

* Update

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Panquesito7 pushed a commit to Panquesito7/Python that referenced this pull request May 13, 2021
* Instagram Video and IGTV downloader 

Download Video and IGTV from Instagram

* Update

* Update

* Some Change

* Update

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
shermanhui pushed a commit to shermanhui/Python that referenced this pull request Oct 22, 2021
* Instagram Video and IGTV downloader 

Download Video and IGTV from Instagram

* Update

* Update

* Some Change

* Update

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

* Update instagram_video.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
require tests Tests [doctest/unittest/pytest] are required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants