-
Notifications
You must be signed in to change notification settings - Fork 4
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
Created CLI and Implemented Runtime profiling #5
base: master
Are you sure you want to change the base?
Conversation
…Consistency in _cli.py, including variable/parameter names. Update README.md
The CLI looks good. A few things though, mostly related to testing (which you can run from the package root directory using the
Before I accept this PR, I'd like to see
|
Got it! Sending async requests definitely improves it, and I'm starting to think I overdid it with the profiling thing😅 |
So, in order for the tests to run successfully, I will have to make major changes to the test files, like having a separate test function for each api function that is to be tested. What do you think about this? |
I'm open to making major changes to the test files as long as the functionality of the tests doesn't change (i.e. all functions/methods are sufficiently tested). I chose that specific implementation to reduce redundancy. Why would you need to separate the api test functions? Would an approach like the one mentioned in this answer work here? |
The need to create separate test functions comes from the fact that all api functions now need a/an aiohttp session. This is because I was trying to avoid creating a new session for each api function call. So, in the tests, a similar approach (like the one on the stackoverflow answer) would be more resource friendly. Having a fixture function to create a session and then use it for all tests. If any issues arise from that, I might go ahead and use a new session for each test (for the sake of testing). I've encountered an issue in tests, where a fixture function for creating a session wasn't working because it yelded an AsyncGenerator and not a ClientSession. So, I had to instead create a new session for each test. |
Hi @trislee, I created the CLI and implemented run-time profiling (which is optionally enabled)
Here are some key changes I made:
--runtime-prof
)make_request
function, as per the TODO note left in code (I tried to make minimal changes as possible)Screenshots
CLI Examples
Channel Operations
Get channel profile
Get channel videos
Get channel subscribers
Video Operations
Get video views
Get video comments
Get video reactions
Get video streaming url
Get recommended videos
Miscellaneous Operations
Append comments reactions
Convert normalized names to video info