youtube-local.scm 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. (define-module (python youtube-local)
  2. #:use-module ((guix licenses) #:prefix license:)
  3. #:use-module (guix build-system python)
  4. #:use-module (gnu packages)
  5. #:use-module (gnu packages python)
  6. #:use-module (gnu packages python-compression)
  7. #:use-module (gnu packages python-web)
  8. #:use-module (gnu packages python-xyz)
  9. #:use-module (gnu packages xml)
  10. #:use-module (guix packages)
  11. #:use-module (guix download)
  12. #:use-module (guix git-download))
  13. (define-public python-cachetools
  14. (package
  15. (name "python-cachetools")
  16. (version "4.1.1")
  17. (source
  18. (origin
  19. (method url-fetch)
  20. (uri (pypi-uri "cachetools" version))
  21. (sha256
  22. (base32
  23. "086vkqy084rd0xlfnyyylwr2vp8qrz806aywy9fif06yvv1kkamv"))))
  24. (build-system python-build-system)
  25. (home-page "https://github.com/tkem/cachetools/")
  26. (synopsis
  27. "Extensible memoizing collections and decorators")
  28. (description
  29. "Extensible memoizing collections and decorators")
  30. (license license:expat)))
  31. (define-public youtube-local
  32. (package
  33. (name "youtube-local")
  34. (version "2.3.2")
  35. (source (origin
  36. (method git-fetch)
  37. (uri (git-reference
  38. (url "https://github.com/user234683/youtube-local.git")
  39. (commit (string-append "v" version))))
  40. (file-name (git-file-name name version))
  41. (sha256
  42. (base32
  43. "19ynbszn7mm7w7p48xmg372y4n4gq3q4krli0fixqkvabzc5n987"))
  44. (modules '((guix build utils)))
  45. (snippet
  46. '(begin
  47. (substitute* "server.py"
  48. (("from gevent import monkey")
  49. "#!/usr/bin/env python3\nfrom gevent import monkey"))))))
  50. (build-system python-build-system)
  51. (arguments
  52. `(#:phases
  53. (modify-phases %standard-phases
  54. (delete 'build)
  55. (delete 'check)
  56. (replace 'install
  57. (lambda* (#:key outputs #:allow-other-keys)
  58. (let* ((source (assoc-ref %build-inputs "source"))
  59. (out (assoc-ref outputs "out"))
  60. (bin (string-append out "/bin"))
  61. (target (string-append bin "/youtube-local-server"))
  62. (share (string-append out "/share"))
  63. (yt (string-append out "/share/youtube")))
  64. (mkdir-p yt)
  65. (copy-recursively "youtube" yt)
  66. (install-file "settings.py" share)
  67. (mkdir-p bin)
  68. (copy-file "server.py" target)
  69. (chmod target #o555)
  70. (with-directory-excursion bin
  71. (setenv "PYTHONPATH"
  72. (string-append share
  73. ":"
  74. (getenv "PYTHONPATH")))
  75. (wrap-program target
  76. `("PYTHONPATH" = (,(getenv "PYTHONPATH")))))
  77. #t))))))
  78. (inputs
  79. `(("python" ,python)
  80. ("python-brotli" ,python-brotli)
  81. ("python-gevent" ,python-gevent)
  82. ("python-flask" ,python-flask)
  83. ("python-pysocks" ,python-pysocks)
  84. ("python-urllib3" ,python-urllib3)
  85. ("python-defusedxml" ,python-defusedxml)
  86. ("python-cachetools" ,python-cachetools)))
  87. (home-page "https://github.com/user234683/youtube-local")
  88. (synopsis "Browser-based client for watching Youtube")
  89. (description "youtube-local is a browser-based client written in
  90. Python for watching Youtube anonymously and without the lag of the
  91. slow page used by Youtube.")
  92. (license license:agpl3)))
  93. youtube-local