diff options
| -rw-r--r-- | .vscode/settings.json | 7 | ||||
| -rw-r--r-- | poetry.lock | 262 | ||||
| -rw-r--r-- | pyproject.toml | 12 | ||||
| -rw-r--r-- | video2story/__init__.py | 2 | ||||
| -rw-r--r-- | video2story/__main__.py | 127 | ||||
| -rw-r--r-- | video2story/cutter.py | 5 | ||||
| -rw-r--r-- | video2story/uploader.py | 2 |
7 files changed, 417 insertions, 0 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a205f43 --- /dev/null +++ b/.vscode/settings.json | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | { | ||
| 2 | "files.exclude": { | ||
| 3 | "**/__pycache__": true, | ||
| 4 | "**/.venv": true | ||
| 5 | }, | ||
| 6 | "cSpell.words": ["screenshotting"] | ||
| 7 | } | ||
diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..4760091 --- /dev/null +++ b/poetry.lock | |||
| @@ -0,0 +1,262 @@ | |||
| 1 | # This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. | ||
| 2 | |||
| 3 | [[package]] | ||
| 4 | name = "black" | ||
| 5 | version = "24.8.0" | ||
| 6 | description = "The uncompromising code formatter." | ||
| 7 | optional = false | ||
| 8 | python-versions = ">=3.8" | ||
| 9 | files = [ | ||
| 10 | {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, | ||
| 11 | {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, | ||
| 12 | {file = "black-24.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42"}, | ||
| 13 | {file = "black-24.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a"}, | ||
| 14 | {file = "black-24.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1"}, | ||
| 15 | {file = "black-24.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af"}, | ||
| 16 | {file = "black-24.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4"}, | ||
| 17 | {file = "black-24.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af"}, | ||
| 18 | {file = "black-24.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368"}, | ||
| 19 | {file = "black-24.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed"}, | ||
| 20 | {file = "black-24.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018"}, | ||
| 21 | {file = "black-24.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2"}, | ||
| 22 | {file = "black-24.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd"}, | ||
| 23 | {file = "black-24.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2"}, | ||
| 24 | {file = "black-24.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e"}, | ||
| 25 | {file = "black-24.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920"}, | ||
| 26 | {file = "black-24.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c"}, | ||
| 27 | {file = "black-24.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e"}, | ||
| 28 | {file = "black-24.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47"}, | ||
| 29 | {file = "black-24.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb"}, | ||
| 30 | {file = "black-24.8.0-py3-none-any.whl", hash = "sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed"}, | ||
| 31 | {file = "black-24.8.0.tar.gz", hash = "sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f"}, | ||
| 32 | ] | ||
| 33 | |||
| 34 | [package.dependencies] | ||
| 35 | click = ">=8.0.0" | ||
| 36 | mypy-extensions = ">=0.4.3" | ||
| 37 | packaging = ">=22.0" | ||
| 38 | pathspec = ">=0.9.0" | ||
| 39 | platformdirs = ">=2" | ||
| 40 | tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} | ||
| 41 | typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} | ||
| 42 | |||
| 43 | [package.extras] | ||
| 44 | colorama = ["colorama (>=0.4.3)"] | ||
| 45 | d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] | ||
| 46 | jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] | ||
| 47 | uvloop = ["uvloop (>=0.15.2)"] | ||
| 48 | |||
| 49 | [[package]] | ||
| 50 | name = "click" | ||
| 51 | version = "8.1.7" | ||
| 52 | description = "Composable command line interface toolkit" | ||
| 53 | optional = false | ||
| 54 | python-versions = ">=3.7" | ||
| 55 | files = [ | ||
| 56 | {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, | ||
| 57 | {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, | ||
| 58 | ] | ||
| 59 | |||
| 60 | [package.dependencies] | ||
| 61 | colorama = {version = "*", markers = "platform_system == \"Windows\""} | ||
| 62 | |||
| 63 | [[package]] | ||
| 64 | name = "colorama" | ||
| 65 | version = "0.4.6" | ||
| 66 | description = "Cross-platform colored terminal text." | ||
| 67 | optional = false | ||
| 68 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" | ||
| 69 | files = [ | ||
| 70 | {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, | ||
| 71 | {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, | ||
| 72 | ] | ||
| 73 | |||
| 74 | [[package]] | ||
| 75 | name = "ffmpeg-python" | ||
| 76 | version = "0.2.0" | ||
| 77 | description = "Python bindings for FFmpeg - with complex filtering support" | ||
| 78 | optional = false | ||
| 79 | python-versions = "*" | ||
| 80 | files = [ | ||
| 81 | {file = "ffmpeg-python-0.2.0.tar.gz", hash = "sha256:65225db34627c578ef0e11c8b1eb528bb35e024752f6f10b78c011f6f64c4127"}, | ||
| 82 | {file = "ffmpeg_python-0.2.0-py3-none-any.whl", hash = "sha256:ac441a0404e053f8b6a1113a77c0f452f1cfc62f6344a769475ffdc0f56c23c5"}, | ||
| 83 | ] | ||
| 84 | |||
| 85 | [package.dependencies] | ||
| 86 | future = "*" | ||
| 87 | |||
| 88 | [package.extras] | ||
| 89 | dev = ["Sphinx (==2.1.0)", "future (==0.17.1)", "numpy (==1.16.4)", "pytest (==4.6.1)", "pytest-mock (==1.10.4)", "tox (==3.12.1)"] | ||
| 90 | |||
| 91 | [[package]] | ||
| 92 | name = "future" | ||
| 93 | version = "1.0.0" | ||
| 94 | description = "Clean single-source support for Python 3 and 2" | ||
| 95 | optional = false | ||
| 96 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" | ||
| 97 | files = [ | ||
| 98 | {file = "future-1.0.0-py3-none-any.whl", hash = "sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216"}, | ||
| 99 | {file = "future-1.0.0.tar.gz", hash = "sha256:bd2968309307861edae1458a4f8a4f3598c03be43b97521076aebf5d94c07b05"}, | ||
| 100 | ] | ||
| 101 | |||
| 102 | [[package]] | ||
| 103 | name = "isort" | ||
| 104 | version = "5.13.2" | ||
| 105 | description = "A Python utility / library to sort Python imports." | ||
| 106 | optional = false | ||
| 107 | python-versions = ">=3.8.0" | ||
| 108 | files = [ | ||
| 109 | {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, | ||
| 110 | {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, | ||
| 111 | ] | ||
| 112 | |||
| 113 | [package.extras] | ||
| 114 | colors = ["colorama (>=0.4.6)"] | ||
| 115 | |||
| 116 | [[package]] | ||
| 117 | name = "mypy" | ||
| 118 | version = "1.11.2" | ||
| 119 | description = "Optional static typing for Python" | ||
| 120 | optional = false | ||
| 121 | python-versions = ">=3.8" | ||
| 122 | files = [ | ||
| 123 | {file = "mypy-1.11.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d42a6dd818ffce7be66cce644f1dff482f1d97c53ca70908dff0b9ddc120b77a"}, | ||
| 124 | {file = "mypy-1.11.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:801780c56d1cdb896eacd5619a83e427ce436d86a3bdf9112527f24a66618fef"}, | ||
| 125 | {file = "mypy-1.11.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:41ea707d036a5307ac674ea172875f40c9d55c5394f888b168033177fce47383"}, | ||
| 126 | {file = "mypy-1.11.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6e658bd2d20565ea86da7d91331b0eed6d2eee22dc031579e6297f3e12c758c8"}, | ||
| 127 | {file = "mypy-1.11.2-cp310-cp310-win_amd64.whl", hash = "sha256:478db5f5036817fe45adb7332d927daa62417159d49783041338921dcf646fc7"}, | ||
| 128 | {file = "mypy-1.11.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:75746e06d5fa1e91bfd5432448d00d34593b52e7e91a187d981d08d1f33d4385"}, | ||
| 129 | {file = "mypy-1.11.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a976775ab2256aadc6add633d44f100a2517d2388906ec4f13231fafbb0eccca"}, | ||
| 130 | {file = "mypy-1.11.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cd953f221ac1379050a8a646585a29574488974f79d8082cedef62744f0a0104"}, | ||
| 131 | {file = "mypy-1.11.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:57555a7715c0a34421013144a33d280e73c08df70f3a18a552938587ce9274f4"}, | ||
| 132 | {file = "mypy-1.11.2-cp311-cp311-win_amd64.whl", hash = "sha256:36383a4fcbad95f2657642a07ba22ff797de26277158f1cc7bd234821468b1b6"}, | ||
| 133 | {file = "mypy-1.11.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e8960dbbbf36906c5c0b7f4fbf2f0c7ffb20f4898e6a879fcf56a41a08b0d318"}, | ||
| 134 | {file = "mypy-1.11.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:06d26c277962f3fb50e13044674aa10553981ae514288cb7d0a738f495550b36"}, | ||
| 135 | {file = "mypy-1.11.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6e7184632d89d677973a14d00ae4d03214c8bc301ceefcdaf5c474866814c987"}, | ||
| 136 | {file = "mypy-1.11.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3a66169b92452f72117e2da3a576087025449018afc2d8e9bfe5ffab865709ca"}, | ||
| 137 | {file = "mypy-1.11.2-cp312-cp312-win_amd64.whl", hash = "sha256:969ea3ef09617aff826885a22ece0ddef69d95852cdad2f60c8bb06bf1f71f70"}, | ||
| 138 | {file = "mypy-1.11.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:37c7fa6121c1cdfcaac97ce3d3b5588e847aa79b580c1e922bb5d5d2902df19b"}, | ||
| 139 | {file = "mypy-1.11.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4a8a53bc3ffbd161b5b2a4fff2f0f1e23a33b0168f1c0778ec70e1a3d66deb86"}, | ||
| 140 | {file = "mypy-1.11.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ff93107f01968ed834f4256bc1fc4475e2fecf6c661260066a985b52741ddce"}, | ||
| 141 | {file = "mypy-1.11.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:edb91dded4df17eae4537668b23f0ff6baf3707683734b6a818d5b9d0c0c31a1"}, | ||
| 142 | {file = "mypy-1.11.2-cp38-cp38-win_amd64.whl", hash = "sha256:ee23de8530d99b6db0573c4ef4bd8f39a2a6f9b60655bf7a1357e585a3486f2b"}, | ||
| 143 | {file = "mypy-1.11.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:801ca29f43d5acce85f8e999b1e431fb479cb02d0e11deb7d2abb56bdaf24fd6"}, | ||
| 144 | {file = "mypy-1.11.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:af8d155170fcf87a2afb55b35dc1a0ac21df4431e7d96717621962e4b9192e70"}, | ||
| 145 | {file = "mypy-1.11.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f7821776e5c4286b6a13138cc935e2e9b6fde05e081bdebf5cdb2bb97c9df81d"}, | ||
| 146 | {file = "mypy-1.11.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:539c570477a96a4e6fb718b8d5c3e0c0eba1f485df13f86d2970c91f0673148d"}, | ||
| 147 | {file = "mypy-1.11.2-cp39-cp39-win_amd64.whl", hash = "sha256:3f14cd3d386ac4d05c5a39a51b84387403dadbd936e17cb35882134d4f8f0d24"}, | ||
| 148 | {file = "mypy-1.11.2-py3-none-any.whl", hash = "sha256:b499bc07dbdcd3de92b0a8b29fdf592c111276f6a12fe29c30f6c417dd546d12"}, | ||
| 149 | {file = "mypy-1.11.2.tar.gz", hash = "sha256:7f9993ad3e0ffdc95c2a14b66dee63729f021968bff8ad911867579c65d13a79"}, | ||
| 150 | ] | ||
| 151 | |||
| 152 | [package.dependencies] | ||
| 153 | mypy-extensions = ">=1.0.0" | ||
| 154 | tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} | ||
| 155 | typing-extensions = ">=4.6.0" | ||
| 156 | |||
| 157 | [package.extras] | ||
| 158 | dmypy = ["psutil (>=4.0)"] | ||
| 159 | install-types = ["pip"] | ||
| 160 | mypyc = ["setuptools (>=50)"] | ||
| 161 | reports = ["lxml"] | ||
| 162 | |||
| 163 | [[package]] | ||
| 164 | name = "mypy-extensions" | ||
| 165 | version = "1.0.0" | ||
| 166 | description = "Type system extensions for programs checked with the mypy type checker." | ||
| 167 | optional = false | ||
| 168 | python-versions = ">=3.5" | ||
| 169 | files = [ | ||
| 170 | {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, | ||
| 171 | {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, | ||
| 172 | ] | ||
| 173 | |||
| 174 | [[package]] | ||
| 175 | name = "packaging" | ||
| 176 | version = "24.1" | ||
| 177 | description = "Core utilities for Python packages" | ||
| 178 | optional = false | ||
| 179 | python-versions = ">=3.8" | ||
| 180 | files = [ | ||
| 181 | {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, | ||
| 182 | {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, | ||
| 183 | ] | ||
| 184 | |||
| 185 | [[package]] | ||
| 186 | name = "pathspec" | ||
| 187 | version = "0.12.1" | ||
| 188 | description = "Utility library for gitignore style pattern matching of file paths." | ||
| 189 | optional = false | ||
| 190 | python-versions = ">=3.8" | ||
| 191 | files = [ | ||
| 192 | {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, | ||
| 193 | {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, | ||
| 194 | ] | ||
| 195 | |||
| 196 | [[package]] | ||
| 197 | name = "platformdirs" | ||
| 198 | version = "4.3.2" | ||
| 199 | description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." | ||
| 200 | optional = false | ||
| 201 | python-versions = ">=3.8" | ||
| 202 | files = [ | ||
| 203 | {file = "platformdirs-4.3.2-py3-none-any.whl", hash = "sha256:eb1c8582560b34ed4ba105009a4badf7f6f85768b30126f351328507b2beb617"}, | ||
| 204 | {file = "platformdirs-4.3.2.tar.gz", hash = "sha256:9e5e27a08aa095dd127b9f2e764d74254f482fef22b0970773bfba79d091ab8c"}, | ||
| 205 | ] | ||
| 206 | |||
| 207 | [package.extras] | ||
| 208 | docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] | ||
| 209 | test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] | ||
| 210 | type = ["mypy (>=1.11.2)"] | ||
| 211 | |||
| 212 | [[package]] | ||
| 213 | name = "python-telegram" | ||
| 214 | version = "0.19.0" | ||
| 215 | description = "Python library to help you build your own Telegram clients" | ||
| 216 | optional = false | ||
| 217 | python-versions = ">=3.9" | ||
| 218 | files = [ | ||
| 219 | {file = "python_telegram-0.19.0-py3-none-any.whl", hash = "sha256:1e1d5e065a000580eeaeb5b608e410651320f5d6c804e8e4e7568b6b614071bc"}, | ||
| 220 | {file = "python_telegram-0.19.0.tar.gz", hash = "sha256:7b5b2da3d01d4cf5776c92f91fdd35a0f98976eec2356726b338f59ba01d1373"}, | ||
| 221 | ] | ||
| 222 | |||
| 223 | [package.dependencies] | ||
| 224 | telegram-text = "0.2.0" | ||
| 225 | |||
| 226 | [[package]] | ||
| 227 | name = "telegram-text" | ||
| 228 | version = "0.2.0" | ||
| 229 | description = "Python markup module for Telegram messenger. This module provides a rich list of components to build any possible markup fast and render it to specific html or MarkdownV2 formats." | ||
| 230 | optional = false | ||
| 231 | python-versions = ">=3.8.1,<4.0.0" | ||
| 232 | files = [ | ||
| 233 | {file = "telegram_text-0.2.0-py3-none-any.whl", hash = "sha256:5752744dc5f91f3f7f0ec1becbf10adb86d586d9338e0aef74fd76a7261283ca"}, | ||
| 234 | {file = "telegram_text-0.2.0.tar.gz", hash = "sha256:ee295a35f2c77246dd9a80c5e1a8deccc598958dff35740697901c632c6121fa"}, | ||
| 235 | ] | ||
| 236 | |||
| 237 | [[package]] | ||
| 238 | name = "tomli" | ||
| 239 | version = "2.0.1" | ||
| 240 | description = "A lil' TOML parser" | ||
| 241 | optional = false | ||
| 242 | python-versions = ">=3.7" | ||
| 243 | files = [ | ||
| 244 | {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, | ||
| 245 | {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, | ||
| 246 | ] | ||
| 247 | |||
| 248 | [[package]] | ||
| 249 | name = "typing-extensions" | ||
| 250 | version = "4.12.2" | ||
| 251 | description = "Backported and Experimental Type Hints for Python 3.8+" | ||
| 252 | optional = false | ||
| 253 | python-versions = ">=3.8" | ||
| 254 | files = [ | ||
| 255 | {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, | ||
| 256 | {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, | ||
| 257 | ] | ||
| 258 | |||
| 259 | [metadata] | ||
| 260 | lock-version = "2.0" | ||
| 261 | python-versions = "^3.10" | ||
| 262 | content-hash = "57d800ac4f8df8b2189422300c98cbe5d2c045eaa6f29351e873f8c92bb2ba4d" | ||
diff --git a/pyproject.toml b/pyproject.toml index ca8814d..acba697 100644 --- a/pyproject.toml +++ b/pyproject.toml | |||
| @@ -7,6 +7,18 @@ readme = "README.md" | |||
| 7 | 7 | ||
| 8 | [tool.poetry.dependencies] | 8 | [tool.poetry.dependencies] |
| 9 | python = "^3.10" | 9 | python = "^3.10" |
| 10 | ffmpeg-python = "^0.2.0" | ||
| 11 | python-telegram = "^0.19.0" | ||
| 12 | |||
| 13 | [tool.poetry.group.dev.dependencies] | ||
| 14 | mypy = "^1.11.2" | ||
| 15 | isort = "^5.13.2" | ||
| 16 | black = "^24.8.0" | ||
| 17 | |||
| 18 | [tool.mypy] | ||
| 19 | ignore_missing_imports = true | ||
| 20 | disallow_untyped_defs = true | ||
| 21 | disallow_untyped_calls = true | ||
| 10 | 22 | ||
| 11 | [build-system] | 23 | [build-system] |
| 12 | requires = ["poetry-core"] | 24 | requires = ["poetry-core"] |
diff --git a/video2story/__init__.py b/video2story/__init__.py index e69de29..77e4018 100644 --- a/video2story/__init__.py +++ b/video2story/__init__.py | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | from .cutter import cut | ||
| 2 | from .uploader import upload | ||
diff --git a/video2story/__main__.py b/video2story/__main__.py new file mode 100644 index 0000000..1b65f2a --- /dev/null +++ b/video2story/__main__.py | |||
| @@ -0,0 +1,127 @@ | |||
| 1 | from argparse import ArgumentParser, RawTextHelpFormatter | ||
| 2 | |||
| 3 | parser = ArgumentParser( | ||
| 4 | prog="video2story", | ||
| 5 | description="Simple telegram story uploader", | ||
| 6 | formatter_class=RawTextHelpFormatter, | ||
| 7 | ) | ||
| 8 | subparsers = parser.add_subparsers( | ||
| 9 | metavar="MODULE", | ||
| 10 | dest="module", | ||
| 11 | required=True, | ||
| 12 | ) | ||
| 13 | |||
| 14 | video_parser = subparsers.add_parser( | ||
| 15 | "video", | ||
| 16 | help="Video processing module", | ||
| 17 | formatter_class=RawTextHelpFormatter, | ||
| 18 | ) | ||
| 19 | |||
| 20 | video_parser.add_argument( | ||
| 21 | "filename", | ||
| 22 | type=str, | ||
| 23 | metavar="FILENAME", | ||
| 24 | help="Video file name", | ||
| 25 | ) | ||
| 26 | video_parser.add_argument( | ||
| 27 | "-d", | ||
| 28 | "--duration", | ||
| 29 | type=int, | ||
| 30 | metavar="SECONDS", | ||
| 31 | default=60, | ||
| 32 | help=( | ||
| 33 | "Specifies each story duration.\n" | ||
| 34 | "When set to 0 each story will be an image.\n" | ||
| 35 | "Max value is 60 and min value is 0.\n" | ||
| 36 | "Default is 60." | ||
| 37 | ), | ||
| 38 | ) | ||
| 39 | video_parser.add_argument( | ||
| 40 | "--no-sound", | ||
| 41 | action="store_true", | ||
| 42 | help="Remove sound from video.", | ||
| 43 | ) | ||
| 44 | |||
| 45 | story_parser = subparsers.add_parser( | ||
| 46 | "story", | ||
| 47 | help="Story publishing module", | ||
| 48 | formatter_class=RawTextHelpFormatter, | ||
| 49 | ) | ||
| 50 | |||
| 51 | story_parser.add_argument( | ||
| 52 | "action", | ||
| 53 | type=str, | ||
| 54 | metavar="ACTION", | ||
| 55 | choices=["publish-all", "publish-one"], | ||
| 56 | help=( | ||
| 57 | "Specifies the type of publishing action.\n" | ||
| 58 | "Accept values: `publish-all` and `publish-one`.\n" | ||
| 59 | ), | ||
| 60 | ) | ||
| 61 | story_parser.add_argument( | ||
| 62 | "privacy", | ||
| 63 | type=str, | ||
| 64 | metavar="PRIVACY-MODE", | ||
| 65 | choices=["everyone", "contacts", "selected-users", "close-friends"], | ||
| 66 | help=( | ||
| 67 | "Specifies who can see you story.\n" | ||
| 68 | "Accept values: `everyone`, `contacts`, `selected-users` and `close-friends`.\n" | ||
| 69 | "\n" | ||
| 70 | "If set to `everyone` or `contacts`, the --user flag excludes the user who can see your story.\n" | ||
| 71 | "If set to `selected-users`, the --user flag specifies the user who can see your story.\n" | ||
| 72 | "If set to `close-friends`, the --user flag will have no effect.\n" | ||
| 73 | ), | ||
| 74 | ) | ||
| 75 | story_parser.add_argument( | ||
| 76 | "-u", | ||
| 77 | "--users", | ||
| 78 | type=str, | ||
| 79 | metavar="USERS", | ||
| 80 | nargs="+", | ||
| 81 | help="Behavior depends on privacy mode. See `privacy` description.", | ||
| 82 | ) | ||
| 83 | story_parser.add_argument( | ||
| 84 | "-a", | ||
| 85 | "--active-period", | ||
| 86 | type=str, | ||
| 87 | metavar="PERIOD", | ||
| 88 | choices=["6h", "12h", "24h", "48h"], | ||
| 89 | default="24h", | ||
| 90 | help=( | ||
| 91 | "Period after which the story is moved to archive.\n" | ||
| 92 | "Accept values: `6h`, `12h`, `24h` and `48h`.\n" | ||
| 93 | "Default is 24h." | ||
| 94 | ), | ||
| 95 | ) | ||
| 96 | story_parser.add_argument( | ||
| 97 | "--protected-content", | ||
| 98 | action="store_true", | ||
| 99 | help="Protect story from forwarding and screenshotting.", | ||
| 100 | ) | ||
| 101 | story_parser.add_argument( | ||
| 102 | "-f", | ||
| 103 | "--from", | ||
| 104 | type=int, | ||
| 105 | metavar="VIDEO-ID", | ||
| 106 | default=0, | ||
| 107 | help=( | ||
| 108 | "Specifies the start point of the publication.\n" | ||
| 109 | "VIDEO-ID is the number in the name of processed file.\n" | ||
| 110 | "Default is 0." | ||
| 111 | ), | ||
| 112 | ) | ||
| 113 | story_parser.add_argument( | ||
| 114 | "-t", | ||
| 115 | "--to", | ||
| 116 | type=int, | ||
| 117 | metavar="VIDEO-ID", | ||
| 118 | default=None, | ||
| 119 | help=( | ||
| 120 | "Specifies the end point of the publication.\n" | ||
| 121 | "VIDEO-ID is the number in the name of processed file." | ||
| 122 | ), | ||
| 123 | ) | ||
| 124 | |||
| 125 | |||
| 126 | args = parser.parse_args() | ||
| 127 | print(args) | ||
diff --git a/video2story/cutter.py b/video2story/cutter.py new file mode 100644 index 0000000..880a672 --- /dev/null +++ b/video2story/cutter.py | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | import ffmpeg | ||
| 2 | |||
| 3 | |||
| 4 | def cut(filename: str) -> None: | ||
| 5 | ffmpeg.input(filename).output("test.mp4") | ||
diff --git a/video2story/uploader.py b/video2story/uploader.py new file mode 100644 index 0000000..dde8c98 --- /dev/null +++ b/video2story/uploader.py | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | def upload() -> None: | ||
| 2 | pass \ No newline at end of file | ||
