From 77aa06ac22e8be41a0d1f533aca6fefd1c8f6345 Mon Sep 17 00:00:00 2001 From: Agie Date: Fri, 17 Nov 2023 18:43:02 -0600 Subject: [PATCH] 1.0.1 Stability and combine update --- .gitignore | 3 +- Dockerfile | 9 +- README.md | 7 +- apache.example.conf | 8 + apache.example.mt.conf | 15 + docker-compose.mt.yml | 34 + docker-compose.yml | 7 +- docs/Makefile | 20 + docs/_autosummary/run.rst | 52 + docs/_build/doctrees/_autosummary/run.doctree | Bin 0 -> 24640 bytes docs/_build/doctrees/api.doctree | Bin 0 -> 3013 bytes docs/_build/doctrees/environment.pickle | Bin 0 -> 57683 bytes docs/_build/doctrees/index.doctree | Bin 0 -> 6773 bytes docs/_build/doctrees/usage.doctree | Bin 0 -> 3015 bytes docs/_build/html/.buildinfo | 4 + docs/_build/html/_autosummary/run.html | 155 +++ .../html/_sources/_autosummary/run.rst.txt | 45 + docs/_build/html/_sources/api.rst.txt | 7 + docs/_build/html/_sources/index.rst.txt | 21 + docs/_build/html/_sources/usage.rst.txt | 7 + docs/_build/html/_static/alabaster.css | 703 +++++++++++++ docs/_build/html/_static/basic.css | 925 ++++++++++++++++++ docs/_build/html/_static/custom.css | 1 + docs/_build/html/_static/doctools.js | 156 +++ .../html/_static/documentation_options.js | 13 + docs/_build/html/_static/file.png | Bin 0 -> 286 bytes docs/_build/html/_static/language_data.js | 199 ++++ docs/_build/html/_static/minus.png | Bin 0 -> 90 bytes docs/_build/html/_static/plus.png | Bin 0 -> 90 bytes docs/_build/html/_static/pygments.css | 84 ++ docs/_build/html/_static/searchtools.js | 574 +++++++++++ docs/_build/html/_static/sphinx_highlight.js | 154 +++ docs/_build/html/api.html | 109 +++ docs/_build/html/genindex.html | 126 +++ docs/_build/html/index.html | 111 +++ docs/_build/html/objects.inv | 6 + docs/_build/html/py-modindex.html | 116 +++ docs/_build/html/search.html | 117 +++ docs/_build/html/searchindex.js | 1 + docs/_build/html/usage.html | 103 ++ docs/_build/markdown/_autosummary/run.md | 28 + docs/_build/markdown/api.md | 1 + docs/_build/markdown/index.md | 15 + docs/conf.py | 32 + docs/index.rst | 21 + docs/make.bat | 35 + logo.png | Bin 0 -> 2962 bytes requirements.txt | 4 +- run.py | 226 ++++- start-docker.mt.sh | 3 + start-podman.mt.sh | 3 + 51 files changed, 4206 insertions(+), 54 deletions(-) create mode 100644 apache.example.conf create mode 100644 apache.example.mt.conf create mode 100644 docker-compose.mt.yml create mode 100644 docs/Makefile create mode 100644 docs/_autosummary/run.rst create mode 100644 docs/_build/doctrees/_autosummary/run.doctree create mode 100644 docs/_build/doctrees/api.doctree create mode 100644 docs/_build/doctrees/environment.pickle create mode 100644 docs/_build/doctrees/index.doctree create mode 100644 docs/_build/doctrees/usage.doctree create mode 100644 docs/_build/html/.buildinfo create mode 100644 docs/_build/html/_autosummary/run.html create mode 100644 docs/_build/html/_sources/_autosummary/run.rst.txt create mode 100644 docs/_build/html/_sources/api.rst.txt create mode 100644 docs/_build/html/_sources/index.rst.txt create mode 100644 docs/_build/html/_sources/usage.rst.txt create mode 100644 docs/_build/html/_static/alabaster.css create mode 100644 docs/_build/html/_static/basic.css create mode 100644 docs/_build/html/_static/custom.css create mode 100644 docs/_build/html/_static/doctools.js create mode 100644 docs/_build/html/_static/documentation_options.js create mode 100644 docs/_build/html/_static/file.png create mode 100644 docs/_build/html/_static/language_data.js create mode 100644 docs/_build/html/_static/minus.png create mode 100644 docs/_build/html/_static/plus.png create mode 100644 docs/_build/html/_static/pygments.css create mode 100644 docs/_build/html/_static/searchtools.js create mode 100644 docs/_build/html/_static/sphinx_highlight.js create mode 100644 docs/_build/html/api.html create mode 100644 docs/_build/html/genindex.html create mode 100644 docs/_build/html/index.html create mode 100644 docs/_build/html/objects.inv create mode 100644 docs/_build/html/py-modindex.html create mode 100644 docs/_build/html/search.html create mode 100644 docs/_build/html/searchindex.js create mode 100644 docs/_build/html/usage.html create mode 100644 docs/_build/markdown/_autosummary/run.md create mode 100644 docs/_build/markdown/api.md create mode 100644 docs/_build/markdown/index.md create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 logo.png create mode 100644 start-docker.mt.sh create mode 100644 start-podman.mt.sh diff --git a/.gitignore b/.gitignore index d78e6f1..da4515d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ pyvenv.cfg subex.json vexample_fixed.json vexample.json -.conf.json \ No newline at end of file +.conf.json +__pycache__/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6c756a6..794618f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ FROM docker.io/python:3 RUN apt update -RUN apt install ffmpeg gifsicle +RUN apt install -y ffmpeg gifsicle RUN mkdir /workspace RUN mkdir /workspace/downloads ADD requirements.txt /workspace/ -ADD run.py /workspace -ADD .conf.json /workspace WORKDIR /workspace RUN pip3 install -r requirements.txt -RUN pip3 install --upgrade sentry-sdk -CMD ["python3", "-u", "run.py"] +RUN pip3 install --upgrade sentry-sdk,sphinx +ADD run.py /workspace +ADD .conf.json /workspace diff --git a/README.md b/README.md index b3971ba..1ffab66 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,13 @@ or depending on whether you have docker compose or podman compose installed -For more details please read the inline comments +For an example configuration for Apache please refer to [apache.example.conf](/apache.example.conf) or [apache.example.mt.conf](/apache.example.mt.conf) for multithreading + +For more details please read the [docs](/docs/_build/markdown/index.md) or the inline comments Coming soon: Multi-node functionality + +# License +This code is distributed under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html) \ No newline at end of file diff --git a/apache.example.conf b/apache.example.conf new file mode 100644 index 0000000..01c815b --- /dev/null +++ b/apache.example.conf @@ -0,0 +1,8 @@ + + ServerName #YOURDOMAINHERE + ServerAlias #YOURDOMAINHERE + ProxyPreserveHost On + + ProxyPass / ws://127.0.0.1:8888/ + ProxyPassReverse / ws://127.0.0.1:8888/ + diff --git a/apache.example.mt.conf b/apache.example.mt.conf new file mode 100644 index 0000000..bfb7545 --- /dev/null +++ b/apache.example.mt.conf @@ -0,0 +1,15 @@ + + ServerName #YOURDOMAINHERE + ServerAlias #YOURDOMAINHERE + ProxyPreserveHost On + + + BalancerMember "ws://127.0.0.1:8888" + BalancerMember "ws://127.0.0.1:8889" + BalancerMember "ws://127.0.0.1:8890" + BalancerMember "ws://127.0.0.1:8891" + BalancerMember "ws://127.0.0.1:8892" + + ProxyPass / balancer://siogroup + ProxyPassReverse / balancer://siogroup + diff --git a/docker-compose.mt.yml b/docker-compose.mt.yml new file mode 100644 index 0000000..8d83397 --- /dev/null +++ b/docker-compose.mt.yml @@ -0,0 +1,34 @@ +# Note: you only need multiple services if you are running multithreaded, otherwise you can use the normal docker-compose +services: + yda-rabbit: + image: docker.io/rabbitmq + yt-dlp-api: + build: . + ports: "8888:8888" + volumes: + - ./downloads:/workspace/downloads + command: python -u run.py mt + yt-dlp-api-2: + build: . + ports: "8888:8889" + volumes: + - ./downloads:/workspace/downloads + command: python -u run.py mt + yt-dlp-api-3: + build: . + ports: "8888:8890" + volumes: + - ./downloads:/workspace/downloads + command: python -u run.py mt + yt-dlp-api-4: + build: . + ports: "8888:8891" + volumes: + - ./downloads:/workspace/downloads + command: python -u run.py mt + yt-dlp-api-5: + build: . + ports: "8888:8892" + volumes: + - ./downloads:/workspace/downloads + command: python -u run.py mt \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index bce9697..9894c91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ services: - yt-dlp-web: + yt-dlp-api: build: . ports: "8888:8888" -volumes: - - ./downloads:/workspace/downloads + volumes: + - ./downloads:/workspace/downloads + command: python -u run.py diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_autosummary/run.rst b/docs/_autosummary/run.rst new file mode 100644 index 0000000..c66a523 --- /dev/null +++ b/docs/_autosummary/run.rst @@ -0,0 +1,52 @@ +run +=== + +.. automodule:: run + + + + .. rubric:: Module Attributes + + .. autosummary:: + + conf + confpath + + + + + + .. rubric:: Functions + + .. autosummary:: + + clean + clip + dlProxies + download + downloadDirect + getInfo + getInfoEvent + getProxy + limits + main + makeSafe + make_app + playlist + refreshProxies + resInit + subtitles + toMP3 + + + + + + + + + + + + + diff --git a/docs/_build/doctrees/_autosummary/run.doctree b/docs/_build/doctrees/_autosummary/run.doctree new file mode 100644 index 0000000000000000000000000000000000000000..973a36606d6577fda8aeeeef7bce5ba9d656d269 GIT binary patch literal 24640 zcmd5^dyE~|Szmj-ue%`mU;bc;iW*zpC#3{6nWf~=|6}ev0#FV75xtYCl_Rd_- zotezTyEnm5QX*nBEmAWT1Vs(%AAo`oqENvfw2g`=Z&W~4Md2@`ihn?=geVo|_5045 zGjs0jow*PDZWC$anKS1*=X?FW^PO{NzE4bj_I=M!@c-h&foEFI&YEr*j%%k(opzfh%2Wu()Ou!nU4A%Eho%*cuOwpjX-~&oVPY=EbM=flb26Sz zdD@5%*p|bRjc8MkYkC;^)@Bq!7UF%P>o-n1{_f%!B5g=A?N%er(-z+iYELu0NitDOh)y+j;2JL+hPz)v&$QZMM0p zd)7Kw4c6;=6uLpwZtH$$9ip!J0VKKW{QhXuoQS6^$6z~(I)tXoyTQ464|H+@fA`|= zKKz{|DWC}7;=C`%2Rz;KlX$-E8j;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RUKQo1NGp>(^cNw$D?& zxE4PxoNK4F?$0B>B~bkRb`h+Pv!^P+AACUtpE$y2Sn?&y%izQxBX@5&(WTafyYF+P z=y?=9uZmX9{&kcp&Hf&K^`nCBZ)y^M)Gvuf=Jz2#Qh^vP+baEL%d`o2Z=cEvaed%z zEkypDWh>}#e^GOLAIeG#Z2hv7%zsXk*wZhGW!+n5`Xyl!24JX}!YE=?g0g|(lfE#d z2NYPn#D>M~K{!ciJgb0Yd8JTXL6J!@2xGW?1f`i?I885S zc!pm!>Q+8*N=1<3xHpv<@FQM0v4U@hBMH;;qBo;(MhdZtnNWN#jozVRD+5+UxV=DC z569}&s&9B}<$Sdix!<9WG!LGWCp}yd&MbxFo|DH{lva-C@kyvCd488ws$RnL0KNuR z@$q8}A6_eAY@`pE;c*Do29GD|1NPyRJQk3){v zSMcn9fV2JpU&*tuQ~AE_ zHT(|8&TySuWVO%QXH~9PD|XgB)(6#KUDutSPyGifU#nMF zQT`JVZ2f9cNTVWa^ZE(4%okA}sK$cB-7m0=at)=yu%?cf@P(P7IP&qx{R-9d?{F>fMAcDs!qeC3=@(R7 ztT5pK%uaL&^syiubjqlo2gOjV4SWa8nto1weDS>%=d}|u1p-svjDP{f5(8r7{t5_( z6Y-8x%Hb*Y&sOWsiUZTuVDbi;w$SVSp)p=E0>5AzPM#?Ov=EFB=TXua^1><1ddk&G z*{okMpb~4*HFT2Ya{PM+e1VNW@U3X^*8w6y-b2aI zbm9urHJnL@ zdYGPCjY*5>7QTnj-IBCe4M<>41;tos{$x-?_pqR+zU@L*SHmgw)4*u%dDK%MLWenm zNCOCpxqk39!e&PQCTEtKY literal 0 HcmV?d00001 diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree new file mode 100644 index 0000000000000000000000000000000000000000..216e9d5ecaffc4edeb3aa9998f835628439cd52f GIT binary patch literal 6773 zcmds6TW=gm6;6B`&-m_KVA(|5yO50&Jf7Iuh%ky4Ar_>?#9E zUDfuCqAcMOw1z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+hzq2TTw~03*k)70GOjGolg) zwMLi{U({4#xzKkG- zxAA<@3KYVl3i5Ukmf!p}f2mzJ2+S-;hUcEYzR>&*{=ei~+HEg3tFYdV1X>=#!(%B4 zoUHZAG#4eM9+F3M(-B@zORCpbgmdlgl3KTpTKK=Z + + + + + + + run — yt-dlp-web-api 1.0.1 documentation + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +
+

run

+

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

clean()

clip(sid, data[, loop])

dlProxies()

Return a list of random ingredients as strings.

download(url, isAudio, title, codec[, ...])

Used to avoid filename conflicts

downloadDirect(url, filename)

getInfo(url[, getSubtitles])

getInfoEvent(sid, data)

getProxy()

limits(sid, data)

main()

makeSafe(filename)

make_app()

playlist(sid, data)

refreshProxies()

resInit(method, spinnerid)

subtitles(sid, data)

toMP3(sid, data[, loop])

+
+ + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/_sources/_autosummary/run.rst.txt b/docs/_build/html/_sources/_autosummary/run.rst.txt new file mode 100644 index 0000000..8c98875 --- /dev/null +++ b/docs/_build/html/_sources/_autosummary/run.rst.txt @@ -0,0 +1,45 @@ +run +=== + +.. automodule:: run + + + + + + + + .. rubric:: Functions + + .. autosummary:: + + clean + clip + dlProxies + download + downloadDirect + getInfo + getInfoEvent + getProxy + limits + main + makeSafe + make_app + playlist + refreshProxies + resInit + subtitles + toMP3 + + + + + + + + + + + + + diff --git a/docs/_build/html/_sources/api.rst.txt b/docs/_build/html/_sources/api.rst.txt new file mode 100644 index 0000000..e88c724 --- /dev/null +++ b/docs/_build/html/_sources/api.rst.txt @@ -0,0 +1,7 @@ +API +=== + +.. autosummary:: + :toctree: generated + + ..run \ No newline at end of file diff --git a/docs/_build/html/_sources/index.rst.txt b/docs/_build/html/_sources/index.rst.txt new file mode 100644 index 0000000..5253f58 --- /dev/null +++ b/docs/_build/html/_sources/index.rst.txt @@ -0,0 +1,21 @@ +.. yt-dlp-web-api documentation master file, created by + sphinx-quickstart on Tue Nov 14 05:17:12 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to yt-dlp-web-api's documentation! +========================================== + +.. autosummary:: + :toctree: _autosummary + :recursive: + + api + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/_build/html/_sources/usage.rst.txt b/docs/_build/html/_sources/usage.rst.txt new file mode 100644 index 0000000..57017ff --- /dev/null +++ b/docs/_build/html/_sources/usage.rst.txt @@ -0,0 +1,7 @@ +API +=== + +.. autosummary:: + :toctree: generated + + run \ No newline at end of file diff --git a/docs/_build/html/_static/alabaster.css b/docs/_build/html/_static/alabaster.css new file mode 100644 index 0000000..517d0b2 --- /dev/null +++ b/docs/_build/html/_static/alabaster.css @@ -0,0 +1,703 @@ +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: Georgia, serif; + font-size: 17px; + background-color: #fff; + color: #000; + margin: 0; + padding: 0; +} + + +div.document { + width: 940px; + margin: 30px auto 0 auto; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 220px; +} + +div.sphinxsidebar { + width: 220px; + font-size: 14px; + line-height: 1.5; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.body { + background-color: #fff; + color: #3E4349; + padding: 0 30px 0 30px; +} + +div.body > .section { + text-align: left; +} + +div.footer { + width: 940px; + margin: 20px auto 30px auto; + font-size: 14px; + color: #888; + text-align: right; +} + +div.footer a { + color: #888; +} + +p.caption { + font-family: inherit; + font-size: inherit; +} + + +div.relations { + display: none; +} + + +div.sphinxsidebar a { + color: #444; + text-decoration: none; + border-bottom: 1px dotted #999; +} + +div.sphinxsidebar a:hover { + border-bottom: 1px solid #999; +} + +div.sphinxsidebarwrapper { + padding: 18px 10px; +} + +div.sphinxsidebarwrapper p.logo { + padding: 0; + margin: -10px 0 0 0px; + text-align: center; +} + +div.sphinxsidebarwrapper h1.logo { + margin-top: -10px; + text-align: center; + margin-bottom: 5px; + text-align: left; +} + +div.sphinxsidebarwrapper h1.logo-name { + margin-top: 0px; +} + +div.sphinxsidebarwrapper p.blurb { + margin-top: 0; + font-style: normal; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: Georgia, serif; + color: #444; + font-size: 24px; + font-weight: normal; + margin: 0 0 5px 0; + padding: 0; +} + +div.sphinxsidebar h4 { + font-size: 20px; +} + +div.sphinxsidebar h3 a { + color: #444; +} + +div.sphinxsidebar p.logo a, +div.sphinxsidebar h3 a, +div.sphinxsidebar p.logo a:hover, +div.sphinxsidebar h3 a:hover { + border: none; +} + +div.sphinxsidebar p { + color: #555; + margin: 10px 0; +} + +div.sphinxsidebar ul { + margin: 10px 0; + padding: 0; + color: #000; +} + +div.sphinxsidebar ul li.toctree-l1 > a { + font-size: 120%; +} + +div.sphinxsidebar ul li.toctree-l2 > a { + font-size: 110%; +} + +div.sphinxsidebar input { + border: 1px solid #CCC; + font-family: Georgia, serif; + font-size: 1em; +} + +div.sphinxsidebar hr { + border: none; + height: 1px; + color: #AAA; + background: #AAA; + + text-align: left; + margin-left: 0; + width: 50%; +} + +div.sphinxsidebar .badge { + border-bottom: none; +} + +div.sphinxsidebar .badge:hover { + border-bottom: none; +} + +/* To address an issue with donation coming after search */ +div.sphinxsidebar h3.donation { + margin-top: 10px; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #004B6B; + text-decoration: underline; +} + +a:hover { + color: #6D4100; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: Georgia, serif; + font-weight: normal; + margin: 30px 0px 10px 0px; + padding: 0; +} + +div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } +div.body h2 { font-size: 180%; } +div.body h3 { font-size: 150%; } +div.body h4 { font-size: 130%; } +div.body h5 { font-size: 100%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #DDD; + padding: 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + color: #444; + background: #EAEAEA; +} + +div.body p, div.body dd, div.body li { + line-height: 1.4em; +} + +div.admonition { + margin: 20px 0px; + padding: 10px 30px; + background-color: #EEE; + border: 1px solid #CCC; +} + +div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fafafa; +} + +div.admonition p.admonition-title { + font-family: Georgia, serif; + font-weight: normal; + font-size: 24px; + margin: 0 0 10px 0; + padding: 0; + line-height: 1; +} + +div.admonition p.last { + margin-bottom: 0; +} + +div.highlight { + background-color: #fff; +} + +dt:target, .highlight { + background: #FAF3E8; +} + +div.warning { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.danger { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.error { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.caution { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.attention { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.important { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.note { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.tip { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.hint { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.seealso { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.topic { + background-color: #EEE; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre, tt, code { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.9em; +} + +.hll { + background-color: #FFC; + margin: 0 -12px; + padding: 0 12px; + display: block; +} + +img.screenshot { +} + +tt.descname, tt.descclassname, code.descname, code.descclassname { + font-size: 0.95em; +} + +tt.descname, code.descname { + padding-right: 0.08em; +} + +img.screenshot { + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils { + border: 1px solid #888; + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils td, table.docutils th { + border: 1px solid #888; + padding: 0.25em 0.7em; +} + +table.field-list, table.footnote { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +table.footnote { + margin: 15px 0; + width: 100%; + border: 1px solid #EEE; + background: #FDFDFD; + font-size: 0.9em; +} + +table.footnote + table.footnote { + margin-top: -15px; + border-top: none; +} + +table.field-list th { + padding: 0 0.8em 0 0; +} + +table.field-list td { + padding: 0; +} + +table.field-list p { + margin-bottom: 0.8em; +} + +/* Cloned from + * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 + */ +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +table.footnote td.label { + width: .1px; + padding: 0.3em 0 0.3em 0.5em; +} + +table.footnote td { + padding: 0.3em 0.5em; +} + +dl { + margin-left: 0; + margin-right: 0; + margin-top: 0; + padding: 0; +} + +dl dd { + margin-left: 30px; +} + +blockquote { + margin: 0 0 0 30px; + padding: 0; +} + +ul, ol { + /* Matches the 30px from the narrow-screen "li > ul" selector below */ + margin: 10px 0 10px 30px; + padding: 0; +} + +pre { + background: #EEE; + padding: 7px 30px; + margin: 15px 0px; + line-height: 1.3em; +} + +div.viewcode-block:target { + background: #ffd; +} + +dl pre, blockquote pre, li pre { + margin-left: 0; + padding-left: 30px; +} + +tt, code { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ +} + +tt.xref, code.xref, a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fff; +} + +a.reference { + text-decoration: none; + border-bottom: 1px dotted #004B6B; +} + +/* Don't put an underline on images */ +a.image-reference, a.image-reference:hover { + border-bottom: none; +} + +a.reference:hover { + border-bottom: 1px solid #6D4100; +} + +a.footnote-reference { + text-decoration: none; + font-size: 0.7em; + vertical-align: top; + border-bottom: 1px dotted #004B6B; +} + +a.footnote-reference:hover { + border-bottom: 1px solid #6D4100; +} + +a:hover tt, a:hover code { + background: #EEE; +} + + +@media screen and (max-width: 870px) { + + div.sphinxsidebar { + display: none; + } + + div.document { + width: 100%; + + } + + div.documentwrapper { + margin-left: 0; + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + } + + div.bodywrapper { + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + margin-left: 0; + } + + ul { + margin-left: 0; + } + + li > ul { + /* Matches the 30px from the "ul, ol" selector above */ + margin-left: 30px; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .bodywrapper { + margin: 0; + } + + .footer { + width: auto; + } + + .github { + display: none; + } + + + +} + + + +@media screen and (max-width: 875px) { + + body { + margin: 0; + padding: 20px 30px; + } + + div.documentwrapper { + float: none; + background: #fff; + } + + div.sphinxsidebar { + display: block; + float: none; + width: 102.5%; + margin: 50px -30px -20px -30px; + padding: 10px 20px; + background: #333; + color: #FFF; + } + + div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, + div.sphinxsidebar h3 a { + color: #fff; + } + + div.sphinxsidebar a { + color: #AAA; + } + + div.sphinxsidebar p.logo { + display: none; + } + + div.document { + width: 100%; + margin: 0; + } + + div.footer { + display: none; + } + + div.bodywrapper { + margin: 0; + } + + div.body { + min-height: 0; + padding: 0; + } + + .rtd_doc_footer { + display: none; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .footer { + width: auto; + } + + .github { + display: none; + } +} + + +/* misc. */ + +.revsys-inline { + display: none!important; +} + +/* Make nested-list/multi-paragraph items look better in Releases changelog + * pages. Without this, docutils' magical list fuckery causes inconsistent + * formatting between different release sub-lists. + */ +div#changelog > div.section > ul > li > p:only-child { + margin-bottom: 0; +} + +/* Hide fugly table cell borders in ..bibliography:: directive output */ +table.docutils.citation, table.docutils.citation td, table.docutils.citation th { + border: none; + /* Below needed in some edge cases; if not applied, bottom shadows appear */ + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + + +/* relbar */ + +.related { + line-height: 30px; + width: 100%; + font-size: 0.9rem; +} + +.related.top { + border-bottom: 1px solid #EEE; + margin-bottom: 20px; +} + +.related.bottom { + border-top: 1px solid #EEE; +} + +.related ul { + padding: 0; + margin: 0; + list-style: none; +} + +.related li { + display: inline; +} + +nav#rellinks { + float: right; +} + +nav#rellinks li+li:before { + content: "|"; +} + +nav#breadcrumbs li+li:before { + content: "\00BB"; +} + +/* Hide certain items when printing */ +@media print { + div.related { + display: none; + } +} \ No newline at end of file diff --git a/docs/_build/html/_static/basic.css b/docs/_build/html/_static/basic.css new file mode 100644 index 0000000..30fee9d --- /dev/null +++ b/docs/_build/html/_static/basic.css @@ -0,0 +1,925 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/docs/_build/html/_static/custom.css b/docs/_build/html/_static/custom.css new file mode 100644 index 0000000..2a924f1 --- /dev/null +++ b/docs/_build/html/_static/custom.css @@ -0,0 +1 @@ +/* This file intentionally left blank. */ diff --git a/docs/_build/html/_static/doctools.js b/docs/_build/html/_static/doctools.js new file mode 100644 index 0000000..d06a71d --- /dev/null +++ b/docs/_build/html/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/docs/_build/html/_static/documentation_options.js b/docs/_build/html/_static/documentation_options.js new file mode 100644 index 0000000..d94acc6 --- /dev/null +++ b/docs/_build/html/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '1.0.1', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/docs/_build/html/_static/file.png b/docs/_build/html/_static/file.png new file mode 100644 index 0000000000000000000000000000000000000000..a858a410e4faa62ce324d814e4b816fff83a6fb3 GIT binary patch literal 286 zcmV+(0pb3MP)s`hMrGg#P~ix$^RISR_I47Y|r1 z_CyJOe}D1){SET-^Amu_i71Lt6eYfZjRyw@I6OQAIXXHDfiX^GbOlHe=Ae4>0m)d(f|Me07*qoM6N<$f}vM^LjV8( literal 0 HcmV?d00001 diff --git a/docs/_build/html/_static/language_data.js b/docs/_build/html/_static/language_data.js new file mode 100644 index 0000000..250f566 --- /dev/null +++ b/docs/_build/html/_static/language_data.js @@ -0,0 +1,199 @@ +/* + * language_data.js + * ~~~~~~~~~~~~~~~~ + * + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, is available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/docs/_build/html/_static/minus.png b/docs/_build/html/_static/minus.png new file mode 100644 index 0000000000000000000000000000000000000000..d96755fdaf8bb2214971e0db9c1fd3077d7c419d GIT binary patch literal 90 zcmeAS@N?(olHy`uVBq!ia0vp^+#t*WBp7;*Yy1LIik>cxAr*|t7R?Mi>2?kWtu=nj kDsEF_5m^0CR;1wuP-*O&G^0G}KYk!hp00i_>zopr08q^qX#fBK literal 0 HcmV?d00001 diff --git a/docs/_build/html/_static/plus.png b/docs/_build/html/_static/plus.png new file mode 100644 index 0000000000000000000000000000000000000000..7107cec93a979b9a5f64843235a16651d563ce2d GIT binary patch literal 90 zcmeAS@N?(olHy`uVBq!ia0vp^+#t*WBp7;*Yy1LIik>cxAr*|t7R?Mi>2?kWtu>-2 m3q%Vub%g%s<8sJhVPMczOq}xhg9DJoz~JfX=d#Wzp$Pyb1r*Kz literal 0 HcmV?d00001 diff --git a/docs/_build/html/_static/pygments.css b/docs/_build/html/_static/pygments.css new file mode 100644 index 0000000..57c7df3 --- /dev/null +++ b/docs/_build/html/_static/pygments.css @@ -0,0 +1,84 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #f8f8f8; } +.highlight .c { color: #8f5902; font-style: italic } /* Comment */ +.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ +.highlight .g { color: #000000 } /* Generic */ +.highlight .k { color: #004461; font-weight: bold } /* Keyword */ +.highlight .l { color: #000000 } /* Literal */ +.highlight .n { color: #000000 } /* Name */ +.highlight .o { color: #582800 } /* Operator */ +.highlight .x { color: #000000 } /* Other */ +.highlight .p { color: #000000; font-weight: bold } /* Punctuation */ +.highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #8f5902 } /* Comment.Preproc */ +.highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #a40000 } /* Generic.Deleted */ +.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ +.highlight .ges { color: #000000 } /* Generic.EmphStrong */ +.highlight .gr { color: #ef2929 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #745334 } /* Generic.Prompt */ +.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ +.highlight .kc { color: #004461; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #004461; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #004461; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #004461; font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { color: #004461; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #004461; font-weight: bold } /* Keyword.Type */ +.highlight .ld { color: #000000 } /* Literal.Date */ +.highlight .m { color: #990000 } /* Literal.Number */ +.highlight .s { color: #4e9a06 } /* Literal.String */ +.highlight .na { color: #c4a000 } /* Name.Attribute */ +.highlight .nb { color: #004461 } /* Name.Builtin */ +.highlight .nc { color: #000000 } /* Name.Class */ +.highlight .no { color: #000000 } /* Name.Constant */ +.highlight .nd { color: #888888 } /* Name.Decorator */ +.highlight .ni { color: #ce5c00 } /* Name.Entity */ +.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #000000 } /* Name.Function */ +.highlight .nl { color: #f57900 } /* Name.Label */ +.highlight .nn { color: #000000 } /* Name.Namespace */ +.highlight .nx { color: #000000 } /* Name.Other */ +.highlight .py { color: #000000 } /* Name.Property */ +.highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #000000 } /* Name.Variable */ +.highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */ +.highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */ +.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */ +.highlight .mb { color: #990000 } /* Literal.Number.Bin */ +.highlight .mf { color: #990000 } /* Literal.Number.Float */ +.highlight .mh { color: #990000 } /* Literal.Number.Hex */ +.highlight .mi { color: #990000 } /* Literal.Number.Integer */ +.highlight .mo { color: #990000 } /* Literal.Number.Oct */ +.highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ +.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ +.highlight .sc { color: #4e9a06 } /* Literal.String.Char */ +.highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ +.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ +.highlight .se { color: #4e9a06 } /* Literal.String.Escape */ +.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ +.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ +.highlight .sx { color: #4e9a06 } /* Literal.String.Other */ +.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ +.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ +.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ +.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #000000 } /* Name.Function.Magic */ +.highlight .vc { color: #000000 } /* Name.Variable.Class */ +.highlight .vg { color: #000000 } /* Name.Variable.Global */ +.highlight .vi { color: #000000 } /* Name.Variable.Instance */ +.highlight .vm { color: #000000 } /* Name.Variable.Magic */ +.highlight .il { color: #990000 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/_build/html/_static/searchtools.js b/docs/_build/html/_static/searchtools.js new file mode 100644 index 0000000..7918c3f --- /dev/null +++ b/docs/_build/html/_static/searchtools.js @@ -0,0 +1,574 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + `Search finished, found ${resultCount} page(s) matching the search query.` + ); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent !== undefined) return docContent.textContent; + console.warn( + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + // array of [docname, title, anchor, descr, score, filename] + let results = []; + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + results.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // lookup as object + objectTerms.forEach((term) => + results.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + results = results.reverse(); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/docs/_build/html/_static/sphinx_highlight.js b/docs/_build/html/_static/sphinx_highlight.js new file mode 100644 index 0000000..8a96c69 --- /dev/null +++ b/docs/_build/html/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/docs/_build/html/api.html b/docs/_build/html/api.html new file mode 100644 index 0000000..e77ac8a --- /dev/null +++ b/docs/_build/html/api.html @@ -0,0 +1,109 @@ + + + + + + + + API — yt-dlp-web-api 1.0.1 documentation + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +
+

API

+ + + +
+
+ + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html new file mode 100644 index 0000000..88f8816 --- /dev/null +++ b/docs/_build/html/genindex.html @@ -0,0 +1,126 @@ + + + + + + + Index — yt-dlp-web-api 1.0.1 documentation + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + +

Index

+ +
+ M + | R + +
+

M

+ + +
    +
  • + module + +
  • +
+ +

R

+ + +
+ + + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html new file mode 100644 index 0000000..a95a1bf --- /dev/null +++ b/docs/_build/html/index.html @@ -0,0 +1,111 @@ + + + + + + + + Welcome to yt-dlp-web-api’s documentation! — yt-dlp-web-api 1.0.1 documentation + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +
+

Welcome to yt-dlp-web-api’s documentation!

+ + + +
+
+
+

Indices and tables

+ +
+ + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv new file mode 100644 index 0000000..74a901e --- /dev/null +++ b/docs/_build/html/objects.inv @@ -0,0 +1,6 @@ +# Sphinx inventory version 2 +# Project: yt-dlp-web-api +# Version: +# The remainder of this file is compressed using zlib. +xڅK +09ňnc.%mkx=Obk,Rp7}рK2*-\D$§fݐVp @ YH[F7Dn}ɾg8F T_µ#@G,XwJ䙇y^>JhD5S;U3s/;EY \ No newline at end of file diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html new file mode 100644 index 0000000..4f26039 --- /dev/null +++ b/docs/_build/html/py-modindex.html @@ -0,0 +1,116 @@ + + + + + + + Python Module Index — yt-dlp-web-api 1.0.1 documentation + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + +

Python Module Index

+ +
+ r +
+ + + + + + + +
 
+ r
+ run +
+ + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html new file mode 100644 index 0000000..e2f5e4b --- /dev/null +++ b/docs/_build/html/search.html @@ -0,0 +1,117 @@ + + + + + + + Search — yt-dlp-web-api 1.0.1 documentation + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + + +
+ + + +
+ +
+ + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js new file mode 100644 index 0000000..f9a66c8 --- /dev/null +++ b/docs/_build/html/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"docnames": ["_autosummary/run", "index"], "filenames": ["_autosummary/run.rst", "index.rst"], "titles": ["run", "Welcome to yt-dlp-web-api\u2019s documentation!"], "terms": {"index": 1, "modul": 1, "search": 1, "page": 1, "function": 0}, "objects": {"": [[0, 0, 0, "-", "run"]]}, "objtypes": {"0": "py:module"}, "objnames": {"0": ["py", "module", "Python module"]}, "titleterms": {"welcom": 1, "yt": 1, "dlp": 1, "web": 1, "api": 1, "": 1, "document": 1, "indic": 1, "tabl": 1, "content": [], "run": 0}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"run": [[0, "module-run"]], "Welcome to yt-dlp-web-api\u2019s documentation!": [[1, "welcome-to-yt-dlp-web-api-s-documentation"]], "Indices and tables": [[1, "indices-and-tables"]]}, "indexentries": {}}) \ No newline at end of file diff --git a/docs/_build/html/usage.html b/docs/_build/html/usage.html new file mode 100644 index 0000000..dbb259e --- /dev/null +++ b/docs/_build/html/usage.html @@ -0,0 +1,103 @@ + + + + + + + + API — yt-dlp-web-api 1.0.1 documentation + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +
+

API

+ + + +
+
+ + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/markdown/_autosummary/run.md b/docs/_build/markdown/_autosummary/run.md new file mode 100644 index 0000000..207d125 --- /dev/null +++ b/docs/_build/markdown/_autosummary/run.md @@ -0,0 +1,28 @@ +# run + +### Module Attributes + +| `conf` | Global configuration variable | +|------------|---------------------------------| +| `confpath` | Local path to json config | + +### Functions + +| `clean`() | Clean all files that are older than an hour out of downloads every hour | +|-----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------| +| `clip`(sid, data[, loop]) | Event to clip a given stream and return the clip to the user, the user can optionally convert this clip into a gif | +| `dlProxies`([path]) | Function to download proxies from plain url to a given path. | +| `download`(url, isAudio, title, codec[, ...]) | Generic download method | +| `downloadDirect`(url, filename) | Download file directly, with random proxy if set up | +| `getInfo`(url[, getSubtitles]) | Generic method to get sanitized information about the given url, with a random proxy if set up Try to write subtitles if requested | +| `getInfoEvent`(sid, data) | Generic event to get all the information provided by yt-dlp for a given url | +| `getProxy`() | Get random proxy from proxy list | +| `limits`(sid, data) | Get set limits of server for display in UI | +| `main`() | Main method | +| `makeSafe`(filename) | # Make title file system safe | +| `make_app`() | | +| `playlist`(sid, data[, loop]) | Downloads playlist as a zip of MP3s | +| `refreshProxies`() | Refresh proxies every hour | +| `resInit`(method, spinnerid) | Function to initialize response to client Takes method and spinnerid spinnerid is the id of the spinner object to remove on the ui, none is fine here | +| `subtitles`(sid, data[, loop]) | Two step event 1. | +| `toMP3`(sid, data[, loop]) | Socketio event, takes the client id, a json payload and a loop count for retries Converts link to mp3 file | diff --git a/docs/_build/markdown/api.md b/docs/_build/markdown/api.md new file mode 100644 index 0000000..5932792 --- /dev/null +++ b/docs/_build/markdown/api.md @@ -0,0 +1 @@ +# API diff --git a/docs/_build/markdown/index.md b/docs/_build/markdown/index.md new file mode 100644 index 0000000..5492539 --- /dev/null +++ b/docs/_build/markdown/index.md @@ -0,0 +1,15 @@ + + +# Welcome to yt-dlp-web-api’s documentation! + +| [`run`](_autosummary/run.md#module-run) | Module containing a class, global function, exception, type variable and type alias. | +|-------------------------------------------|----------------------------------------------------------------------------------------| + +# Indices and tables + +* [Index](genindex.md) +* [Module Index](py-modindex.md) +* [Search Page](search.md) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..958cd62 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,32 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +import os, sys +sys.path.insert(0, os.path.abspath('../')) + +project = 'yt-dlp-web-api' +copyright = '2023, wizdevgirl' +author = 'wizdevgirl' +release = '1.0.1' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ['sphinx_markdown_builder', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary'] +autosummary_generate = True + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'alabaster' +html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..e478f6d --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,21 @@ +.. yt-dlp-web-api documentation master file, created by + sphinx-quickstart on Tue Nov 14 05:17:12 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to yt-dlp-web-api's documentation! +========================================== + +.. autosummary:: + :toctree: _autosummary + :recursive: + + run + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1922ccff32d4b945bb328214dcdc2cec57205fd8 GIT binary patch literal 2962 zcmcgudsGuw9=pEokWjEHSV)Ui6x4_yARse@a3Gz@_MMBXH2qZiW6iD{&7L{6p3^^aGMTyayWjWw ze&2WVHQ(FAP=BF50KjmwC-)No5O|3IsxJK66`sEb{y4C2<3|3z;9vljosK+RyLE$) z$-{*GpMTfQ=O-s6ZAx;R#|`d~FR|E@-gf1Ai6pI|c8h0dQ!~q+Ya4GkqgSC@L~-L| za}Er~+gjXKhX|5$8md%jiY&#OS{WtQp=AEg#XFbHYjC%pH)bo{9@n^iSNnqR7aiKL zX1vPN>SO76WSUo7_2IU{(b`*u>(8xQTRKkVh2HToI=_#4C?oQL(>)!3yVG-B=h979 z=MGggpY=NKlXYMu%6k-W?Hh|zE7-%j+#=8C<*ncL?u!}m+osfx z+OP3F`$VZ^MQ{S1O;H`9E(hMcp$cxeE+Tqpb|-BUHiuuFoLBp-c{)YjkvLj-{`||N zlLt(WwKCnWSg?1$ShFD7DM{=w)|D7qaiLAczBZfjA|oh5XG(9CjoKxY^RRuds<5%? z7ubKA&~xVz01W2-?SnLT9-oHy8a8v?{GtN~JKavbb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TfJN9i`bDnP|=MiL9Do;W>?ka3YpoxaO!{sZDPjnhKTe z>0X{KfeE-{euOLe5Rx7q%J3FIS#Ib%itu1aIy!obbtw$Mf9#J>by5E0sv2Y`^mJC` zjhP?fZU6e6tgp*hP8Ud*-qacGdVizIQ zt4Y4=NK+_P%9XWLdq~Dh?^+n@1jVFp3T1@A?Jm;2JFug0EKI+7#%l6|G)=S0Xag{S zo#qv}DLil)T=|&t3@XP;4AR*dn@Kk-vqigC_#KFg} ztQdnLugvAu-#QUxc|Im&95mda0e$Q-r0}6P$agA)%WV;jy1Qyz10<%Bfyw^kmGC$a wBjp^J?my?$DO2FEb}z!GZbH$1^YOGn0aN-5Wu4~`{I3T#Z}R3AZxAH@6}*ek-T(jq literal 0 HcmV?d00001 diff --git a/requirements.txt b/requirements.txt index fc33d41..1f0184f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,6 @@ requests moviepy pygifsicle mutagen -GitPython \ No newline at end of file +GitPython +sphinx-markdown-builder +kombu \ No newline at end of file diff --git a/run.py b/run.py index 82303bb..1a140ab 100644 --- a/run.py +++ b/run.py @@ -1,3 +1,6 @@ +""" + +""" import socketio from yt_dlp import YoutubeDL import json @@ -9,35 +12,43 @@ import random import uuid import zipfile import datetime +import sys from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip from moviepy.editor import VideoFileClip from pygifsicle import optimize from mutagen.easyid3 import EasyID3 import sentry_sdk - +from sentry_sdk import capture_exception # TODO: auto-reload/reload on webhook using gitpython # README: functionality is described once per documentation in order to leave as # little clutter as possible -# Global configuration variable conf = {} +""" Global configuration variable """ -# Load configuratin at runtime -with open(".conf.json", "r") as f: +confpath = ".conf.json" +"""Local path to json config""" + +if "docs" in str(os.getcwd()): + """Check if building docs, if so, change conf path""" + confpath = "../.conf.json" + +# Load configuration at runtime +with open(confpath, "r") as f: conf = json.loads(f.read()) # If using bugcatcher such as Glitchtip/Sentry set it up if conf["bugcatcher"]: sentry_sdk.init(conf["bugcatcherdsn"]) -# Function to download proxies from plain url, this is useful for me, but -# if other people need to utilize a more complex method of downloading proxies -# I recommend implementing it and doing a merge request -def dlProxies(): +def dlProxies(path="proxies.txt"): + """ + Function to download proxies from plain url to a given path. this is useful for me, but if other people need to utilize a more complex method of downloading proxies I recommend implementing it and doing a merge request + """ r = requests.get(conf["proxyListURL"]) - with open("proxies.txt", "w") as f: + with open(path, "w") as f: rlist = r.text.split("\n") rlistfixed = [] for p in rlist[:-1]: @@ -52,10 +63,12 @@ if conf["proxyListURL"] != False: if not os.path.exists("proxies.txt"): dlProxies() -# Function to initialize response to client -# Takes method and spinnerid -# spinnerid is the id of the spinner object to remove on the ui, none is fine here def resInit(method, spinnerid): + """ + Function to initialize response to client + Takes method and spinnerid + spinnerid is the id of the spinner object to remove on the ui, none is fine here + """ res = { "method": method, "error": True, @@ -64,18 +77,29 @@ def resInit(method, spinnerid): return res # create a Socket.IO server -sio = socketio.AsyncServer(cors_allowed_origins=conf["allowedorigins"], async_mode="tornado") +# This will either connect to a message queue or not depending on whether multithreading is specified +sio = "" +if "mt" in sys.argv: + mgr = socketio.KombuManager('amqp://yda-rabbit') + sio = socketio.AsyncServer(cors_allowed_origins=conf["allowedorigins"], async_mode="tornado", client_manager=mgr) +else: + sio = socketio.AsyncServer(cors_allowed_origins=conf["allowedorigins"], async_mode="tornado") + -# Socketio event, takes the client id and a json payload -# Converts link to mp3 file @sio.event -async def toMP3(sid, data): +async def toMP3(sid, data, loop=0): + """ + Socketio event, takes the client id, a json payload and a loop count for retries + Converts link to mp3 file + """ # Initialize response, if spinnerid data doesn't exist it will just set it to none res = resInit("toMP3", data.get("spinnerid")) # Try/catch loop will send error message to client on error try: # Get video url from data url = data["url"] + if "list" in url: + raise ValueError("Method is for singular videos") # Get information about the video via yt-dlp to make future decisions info = getInfo(url) # Return an error if the video is longer than the configured maximum video length @@ -104,14 +128,26 @@ async def toMP3(sid, data): audio.save() # Emit result to client await sio.emit("done", res, sid) + except OSError as e: + capture_exception(e) + if loop > 0: + capture_exception(OSError("Retry unsuccessful")) + # Get text of error + res["details"] = str(e) + await sio.emit("done", res, sid) + else: + await toMP3(sid, data, loop=1) except Exception as e: + capture_exception(e) # Get text of error res["details"] = str(e) await sio.emit("done", res, sid) - -# Downloads playlist as a zip of MP3s + @sio.event -async def playlist(sid, data): +async def playlist(sid, data, loop=0): + """ + Downloads playlist as a zip of MP3s + """ res = resInit("playlist", data.get("spinnerid")) try: purl = data["url"] @@ -142,20 +178,32 @@ async def playlist(sid, data): res["link"] = conf["url"] + "/downloads/" + ptitle + ".zip" res["title"] = title await sio.emit("done", res, sid) - + except OSError as e: + capture_exception(e) + if loop > 0: + # Get text of error + res["details"] = str(e) + await sio.emit("done", res, sid) + else: + await playlist(sid, data, loop=1) except Exception as e: + capture_exception(e) res["details"] = str(e) await sio.emit("done", res, sid) -# Two step event -# 1. Get list of subtitles -# 2. Download chosen subtitle file @sio.event -async def subtitles(sid, data): +async def subtitles(sid, data, loop=0): + """ + Two step event + 1. Get list of subtitles + 2. Download chosen subtitle file + """ res = resInit("subtitles", data.get("spinnerid")) try: step = int(data["step"]) url = data["url"] + if "list" in url: + raise ValueError("Method is for singular videos") # Step 1 of subtitles is to get the list of subtitles available and return them if step == 1: info = getInfo(url, getSubtitles=True) @@ -184,16 +232,30 @@ async def subtitles(sid, data): res["link"] = conf["url"] + "/downloads/" + ftitle + "." + languageCode + ".vtt" res["title"] = title await sio.emit("done", res, sid) + except OSError as e: + capture_exception(e) + if loop > 0: + capture_exception(OSError("Retry unsuccessful")) + # Get text of error + res["details"] = str(e) + await sio.emit("done", res, sid) + else: + await subtitles(sid, data, loop=1) except Exception as e: + capture_exception(e) res["details"] = str(e) await sio.emit("done", res, sid) -# Event to clip a given stream and return the clip to the user, the user can optionally convert this clip into a gif @sio.event -async def clip(sid, data): +async def clip(sid, data, loop=0): + """ + Event to clip a given stream and return the clip to the user, the user can optionally convert this clip into a gif + """ res = resInit("clip", data.get("spinnerid")) try: url = data["url"] + if "list" in url: + raise ValueError("Method is for singular videos") info = getInfo(url) # Check if directURL is in the data from the client # directURL defines a video url to download from directly instead of through yt-dlp @@ -229,34 +291,87 @@ async def clip(sid, data): ititle = download(url, False, title, "mp4", extension=info["ext"], format_id=format_id) else: ititle = download(url, False, title, "mp4", extension=info["ext"]) + cuuid = str(uuid.uuid4()) if gif: # Clip video and then convert it to a gif - (VideoFileClip("downloads/" + ititle)).subclip(timeA, timeB).write_gif("downloads/" + title + "." + str(uuid.uuid4()) + ".clipped.gif") + (VideoFileClip("downloads/" + ititle)).subclip(timeA, timeB).write_gif("downloads/" + title + "." + cuuid+ ".clipped.gif") # Optimize the gif optimize("downloads/" + title + ".clipped.gif") else: # Clip the video and return the mp4 of the clip - ffmpeg_extract_subclip("downloads/" + ititle, timeA, timeB, targetname="downloads/" + title + "." + str(uuid.uuid4()) + ".clipped.mp4") + ffmpeg_extract_subclip("downloads/" + ititle, timeA, timeB, targetname="downloads/" + title + "." + cuuid + ".clipped.mp4") res["error"] = False # Set the extension to use either to mp4 or gif depending on whether the user wanted a gif # The extension is just for creating the url for the clip extension = "mp4" if gif: extension = "gif" - res["link"] = conf["url"] + "/downloads/" + title + ".clipped." + extension + res["link"] = conf["url"] + "/downloads/" + title + "." + cuuid + ".clipped." + extension res["title"] = title await sio.emit("done", res, sid) + except OSError as e: + capture_exception(e) + if loop > 0: + capture_exception(OSError("Retry unsuccessful")) + # Get text of error + res["details"] = str(e) + await sio.emit("done", res, sid) + else: + await clip(sid, data, loop=1) except Exception as e: + capture_exception(e) + res["details"] = str(e) + await sio.emit("done", res, sid) + +@sio.event +async def combine(sid, data, loop=0): + """ + Combine audio and video streams + """ + res = resInit("combine", data.get("spinnerid")) + try: + curl = data["url"] + # Get video info + info = getInfo(curl) + # Create the video title from the file system safe title and a random uuid + # The uuid is to prevent two users from accidentally overwriting each other's files (very unlikely due to cleanup but still possible) + ptitle = makeSafe(info["title"]) + str(uuid.uuid4()) + # If the number of entries is larger than the configured maximum playlist length throw an error + if "list" in curl: + raise ValueError("This method is for a single video") + else: + # Check the length of the video, if it's too long throw an error + if info["duration"] > conf["maxLength"]: + raise ValueError("Video is longer than configured maximum length") + title = download(curl, False, ptitle, False, extension="mp4", format_id=data["format_id"], format_id_audio=data["format_id_audio"]) + res["error"] = False + res["link"] = conf["url"] + "/downloads/" + title + res["title"] = ptitle + await sio.emit("done", res, sid) + except OSError as e: + capture_exception(e) + if loop > 0: + # Get text of error + res["details"] = str(e) + await sio.emit("done", res, sid) + else: + await playlist(sid, data, loop=1) + except Exception as e: + capture_exception(e) res["details"] = str(e) await sio.emit("done", res, sid) -# Generic event to get all the information provided by yt-dlp for a given url @sio.event async def getInfoEvent(sid, data): + """ + Generic event to get all the information provided by yt-dlp for a given url + """ # Unlike other events we set the method here from the passed method in order to make this generic and flexible res = resInit(data["method"], data.get("spinnerid")) try: url = data["url"] + if "list" in url: + raise ValueError("Method is for singular videos") info = getInfo(url) if data["method"] == "streams": res["details"] = "" @@ -267,12 +382,15 @@ async def getInfoEvent(sid, data): res["info"] = info await sio.emit("done", res, sid) except Exception as e: + capture_exception(e) res["details"] = str(e) await sio.emit("done", res, sid) -# Get limits of server for display in UI @sio.event async def limits(sid, data): + """ + Get set limits of server for display in UI + """ res = resInit("limits", data.get("spinnerid")) try: limits = [ @@ -286,11 +404,14 @@ async def limits(sid, data): res["error"] = False await sio.emit("done", res, sid) except Exception as e: + capture_exception(e) res["details"] = str(e) await sio.emit("done", res, sid) -# Generic download method -def download(url, isAudio, title, codec, languageCode=None, autoSub=False, extension=False, format_id=False): +def download(url, isAudio, title, codec, languageCode=None, autoSub=False, extension=False, format_id=False, format_id_audio=False): + """ + Generic download method + """ # Used to avoid filename conflicts ukey = str(uuid.uuid4()) # Set the location/name of the output file @@ -313,6 +434,9 @@ def download(url, isAudio, title, codec, languageCode=None, autoSub=False, exten # Check if there's a format id, if so set the download format to that format id if format_id != False: ydl_opts['format'] = format_id + if format_id_audio != False: + ydl_opts['format'] += "+" + format_id_audio + print(ydl_opts['format']) # Otherwise if we're downloading subtitles... elif codec == "subtitles": # Set up to write the subtitles to disk @@ -341,8 +465,10 @@ def download(url, isAudio, title, codec, languageCode=None, autoSub=False, exten res += "." + extension return res -# Download file directly, with random proxy if set up def downloadDirect(url, filename): + """ + Download file directly, with random proxy if set up + """ if conf["proxyListURL"] != False: proxies = {'https': 'https://' + getProxy()} with requests.get(url, proxies=proxies, stream=True) as r: @@ -357,9 +483,12 @@ def downloadDirect(url, filename): for chunk in r.iter_content(chunk_size=8192): f.write(chunk) -# Generic method to get sanitized information about the given url, with a random proxy if set up -# Try to write subtitles if requested + def getInfo(url, getSubtitles=False): + """ + Generic method to get sanitized information about the given url, with a random proxy if set up + Try to write subtitles if requested + """ info = { "writesubtitles": getSubtitles } @@ -370,28 +499,37 @@ def getInfo(url, getSubtitles=False): info = ydl.sanitize_info(info) return info -# Make title file system safe -# https://stackoverflow.com/questions/7406102/create-sane-safe-filename-from-any-unsafe-string + def makeSafe(filename): + """ + # Make title file system safe +# https://stackoverflow.com/questions/7406102/create-sane-safe-filename-from-any-unsafe-string + """ return "".join([c for c in filename if c.isalpha() or c.isdigit() or c==' ']).rstrip() -# Get random proxy from proxy list def getProxy(): + """ + Get random proxy from proxy list + """ proxy = "" with open("proxies.txt", "r") as f: proxy = random.choice(f.read().split("\n")) return proxy -# Refresh proxies every hour async def refreshProxies(): + """ + Refresh proxies every hour + """ while True: dlProxies() await asyncio.sleep(3600) -# Clean all files that are older than an hour out of downloads every hour async def clean(): + """ + Clean all files that are older than an hour out of downloads every hour + """ while True: - for f in os.listdir("./downloads"): + for f in os.listdir("downloads"): fmt = datetime.datetime.fromtimestamp(os.path.getmtime('downloads/' + f)) if (datetime.datetime.now() - fmt).total_seconds() > 7200: os.remove("downloads/" + f) @@ -404,8 +542,10 @@ def make_app(): (r"/socket.io/", socketio.get_tornado_handler(sio)) ]) -# Main method async def main(): + """ + Main method + """ # If proxies are configured set up the refresh proxies task if conf["proxyListURL"] != False: task = asyncio.create_task(refreshProxies()) diff --git a/start-docker.mt.sh b/start-docker.mt.sh new file mode 100644 index 0000000..868f4e2 --- /dev/null +++ b/start-docker.mt.sh @@ -0,0 +1,3 @@ +mkdir downloads +docker-compose -f docker-compose.mt.yml build +docker-compose -f docker-compose.mt.yml up \ No newline at end of file diff --git a/start-podman.mt.sh b/start-podman.mt.sh new file mode 100644 index 0000000..5a601cc --- /dev/null +++ b/start-podman.mt.sh @@ -0,0 +1,3 @@ +mkdir downloads +podman-compose -f docker-compose.mt.yml build +podman-compose -f docker-compose.mt.yml up \ No newline at end of file