elizeubarbosaabreu / YouTubeDownloader

Youtube Downloader by PyTube é uma ferramenta simples com interface gráfica e escrito em python para baixar vídeos e playlists do youtube...
6 stars 0 forks source link

Suggest to loosen the dependency on pytube #2

Open Agnes-U opened 2 years ago

Agnes-U commented 2 years ago

Hi, your project Youtube-Downloader-by-PyTube requires "pytube==11.0.1" in its dependency. After analyzing the source code, we found that the following versions of pytube can also be suitable without affecting your project, i.e., pytube 11.0.0, 11.0.2, 12.0.0. Therefore, we suggest to loosen the dependency on pytube from "pytube==11.0.1" to "pytube>=11.0.0,<=12.0.0" to avoid any possible conflict for importing more packages or for downstream projects that may use Youtube-Downloader-by-PyTube.

May I pull a request to further loosen the dependency on pytube?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



We also give our detailed analysis as follows for your reference:

Your project Youtube-Downloader-by-PyTube directly uses 1 APIs from package pytube.

pytube.__main__.YouTube.__init__

Beginning from the 1 APIs above, 9 functions are then indirectly called, including 5 pytube's internal APIs and 4 outsider APIs. The specific call graph is listed as follows (neglecting some repeated function occurrences).

[/elizeubarbosaabreu/Youtube-Downloader-by-PyTube]
+--pytube.__main__.YouTube.__init__
|      +--pytube.extract.video_id
|      |      +--pytube.helpers.regex_search
|      |      |      +--re.compile
|      |      |      +--pytube.exceptions.RegexMatchError.__init__
|      +--pytube.monostate.Monostate.__init__
|      +--pytube.helpers.install_proxy
|      |      +--urllib.request.ProxyHandler
|      |      +--urllib.request.build_opener
|      |      +--urllib.request.install_opener

We scan pytube's versions and observe that during its evolution between any version from [11.0.0, 11.0.2, 12.0.0] and 11.0.1, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 11.0.1(original) 11.0.0
['pytube.cipher.get_throttling_function_name', 'pytube.__main__.YouTube', 'pytube.contrib.playlist.Playlist.last_updated', 'pytube.contrib.search.Search', 'pytube.contrib.search.Search.__init__', 'pytube.contrib.playlist.Playlist']

diff: 11.0.1(original) 11.0.2
['pytube.parser.throttling_array_split']

diff: 11.0.1(original) 12.0.0
['pytube.__main__.YouTube', 'pytube.parser.throttling_array_split', 'pytube.__main__.YouTube.__eq__', 'pytube.cipher.get_throttling_function_name']

As for other packages, the APIs of urllib and re are called by pytube in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on pytube from "pytube==11.0.1" to "pytube>=11.0.0,<=12.0.0". This will improve the applicability of Youtube-Downloader-by-PyTube and reduce the possibility of any further dependency conflict with other projects.