1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 defusedxml,
7 requests,
8 httpretty,
9 pytestCheckHook,
10 pythonOlder,
11}:
12
13buildPythonPackage rec {
14 pname = "youtube-transcript-api";
15 version = "1.0.3";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "jdepoix";
22 repo = "youtube-transcript-api";
23 tag = "v${version}";
24 hash = "sha256-MDa19rI5DaIzrrEt7uNQ5+xSFkRXI5iwt/u5UNvT1f4=";
25 };
26
27 build-system = [ poetry-core ];
28
29 pythonRelaxDeps = [
30 "defusedxml"
31 ];
32
33 dependencies = [
34 defusedxml
35 requests
36 ];
37
38 nativeCheckInputs = [
39 httpretty
40 pytestCheckHook
41 ];
42
43 pythonImportsCheck = [ "youtube_transcript_api" ];
44
45 meta = with lib; {
46 description = "Python API which allows you to get the transcripts/subtitles for a given YouTube video";
47 mainProgram = "youtube_transcript_api";
48 homepage = "https://github.com/jdepoix/youtube-transcript-api";
49 changelog = "https://github.com/jdepoix/youtube-transcript-api/releases/tag/${src.tag}";
50 license = licenses.mit;
51 maintainers = [ ];
52 };
53}