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