1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 requests,
6 mock,
7 httpretty,
8 pytestCheckHook,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "youtube-transcript-api";
14 version = "0.6.2";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "jdepoix";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-xCB1XhXRq4jxyfst/n2wXj2k4dERm+/bVUJwP8b70gQ=";
24 };
25
26 propagatedBuildInputs = [ requests ];
27
28 nativeCheckInputs = [
29 mock
30 httpretty
31 pytestCheckHook
32 ];
33
34 pythonImportsCheck = [ "youtube_transcript_api" ];
35
36 meta = with lib; {
37 description = "Python API which allows you to get the transcripts/subtitles for a given YouTube video";
38 mainProgram = "youtube_transcript_api";
39 homepage = "https://github.com/jdepoix/youtube-transcript-api";
40 changelog = "https://github.com/jdepoix/youtube-transcript-api/releases/tag/v${version}";
41 license = licenses.mit;
42 maintainers = [ ];
43 };
44}