python-youtube icon indicating copy to clipboard operation
python-youtube copied to clipboard

Improvements

Open lucas-montes opened this issue 2 years ago • 1 comments

First of all, great work. As for the facebook one, this library is really cool.

Duplicated code: I haven't dig dipper, but it seems that there is a lot of duplicated code.

  • The resources module has many classes with the same method list, update, etc... maybe that could be moved into a parent class where all the verifications are done at this level.
  • The Client and API classes. They seem very similar. API seems to have methods that for the Client class should be called through a resource. It might be worth to separate the auth part (requesting tokens, refreshing them and so on) into an independent class, then the API class could be removed and use only the Client one as they would do the same thing.

Method's parameters

  • Instead of allowing None values and the checking if the value is None setting a default value, I think that it would be better to set the default value on the parameter itself.

Reduce comments

  • Many methods have comments that are redundant, the method names and parameters are usually clear enough. Nevertheless it might be helpful having a link to the youtube docs.

lucas-montes avatar Dec 18 '22 11:12 lucas-montes

The 'Client' class is a new implementation, while the 'Api' class is an older version. I believe the 'Api' class will be removed in the future.

MerleLiuKun avatar Dec 26 '22 02:12 MerleLiuKun