Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 defusedxml,
7 requests,
8 httpretty,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "youtube-transcript-api";
14 version = "1.2.3";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "jdepoix";
19 repo = "youtube-transcript-api";
20 tag = "v${version}";
21 hash = "sha256-UtKAT7BTWmG2wWnpK5OT/NeVksz6N8sLnRq9IpAm7D4=";
22 };
23
24 build-system = [ poetry-core ];
25
26 pythonRelaxDeps = [
27 "defusedxml"
28 ];
29
30 dependencies = [
31 defusedxml
32 requests
33 ];
34
35 nativeCheckInputs = [
36 httpretty
37 pytestCheckHook
38 ];
39
40 preCheck = ''
41 export PATH=$out/bin:$PATH
42 '';
43
44 disabledTests = [
45 # network access
46 "test_fetch__create_consent_cookie_if_needed"
47 "test_fetch__with_generic_proxy_reraise_when_blocked"
48 "test_fetch__with_proxy_retry_when_blocked"
49 "test_fetch__with_webshare_proxy_reraise_when_blocked"
50 ];
51
52 pythonImportsCheck = [ "youtube_transcript_api" ];
53
54 meta = {
55 description = "Python API which allows you to get the transcripts/subtitles for a given YouTube video";
56 mainProgram = "youtube_transcript_api";
57 homepage = "https://github.com/jdepoix/youtube-transcript-api";
58 changelog = "https://github.com/jdepoix/youtube-transcript-api/releases/tag/${src.tag}";
59 license = lib.licenses.mit;
60 maintainers = [ ];
61 };
62}