commit 105c1d30990c2dedaa0bc895d09cf19bfc8767e4 Author: WorldTeacher Date: Wed Oct 29 19:26:50 2025 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7037468 --- /dev/null +++ b/.gitignore @@ -0,0 +1,233 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# ---> Qt +# C++ objects and libs +*.slo +*.lo +*.o +*.a +*.la +*.lai +*.so +*.so.* +*.dll +*.dylib + +# Qt-es +object_script.*.Release +object_script.*.Debug +*_plugin_import.cpp +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc +moc_*.cpp +moc_*.h +qrc_*.cpp +ui_*.h +*.qmlc +*.jsc +Makefile* +*build-* +*.qm +*.prl + +# Qt unit tests +target_wrapper.* + +# QtCreator +*.autosave + +# QtCreator Qml +*.qmlproject.user +*.qmlproject.user.* + +# QtCreator CMake +CMakeLists.txt.user* + +# QtCreator 4.8< compilation database +compile_commands.json + +# QtCreator local machine specific files for imported projects +*creator.user* + +*_qmlcache.qrc + + +.history +depend +output/output/LOGtoJSON.exe + +.pytest_cache +output +docs/ +config.yaml +**/tempCodeRunnerFile.py + +.history +.venv +venv +*.log diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..aec92ac --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 WorldTeacher + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..f5cecaa --- /dev/null +++ b/main.py @@ -0,0 +1,6 @@ +def main(): + print("Hello from komsuite-web!") + + +if __name__ == "__main__": + main() diff --git a/packages/KomCache b/packages/KomCache new file mode 160000 index 0000000..4e0a19c --- /dev/null +++ b/packages/KomCache @@ -0,0 +1 @@ +Subproject commit 4e0a19c97307ad986ecdb5f67537b1e0a6191b04 diff --git a/packages/KomConfig b/packages/KomConfig new file mode 160000 index 0000000..674e9f9 --- /dev/null +++ b/packages/KomConfig @@ -0,0 +1 @@ +Subproject commit 674e9f9fd5010382d9681f9c020712bd1e41fded diff --git a/packages/KomGrabber b/packages/KomGrabber new file mode 160000 index 0000000..4d0d412 --- /dev/null +++ b/packages/KomGrabber @@ -0,0 +1 @@ +Subproject commit 4d0d412d38a76b348469ad0723693b79c5468709 diff --git a/packages/KomPage b/packages/KomPage new file mode 160000 index 0000000..4ae996b --- /dev/null +++ b/packages/KomPage @@ -0,0 +1 @@ +Subproject commit 4ae996bfd634438991fb16976eba4ff65f568669 diff --git a/packages/KomSearcher/README.md b/packages/KomSearcher/README.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/KomSearcher/background.js b/packages/KomSearcher/background.js new file mode 100644 index 0000000..ee0bd30 --- /dev/null +++ b/packages/KomSearcher/background.js @@ -0,0 +1,53 @@ +// This is the background script for the extension +console.log('Background script running'); + +// Listen for messages from the content script +chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { + if (message.action === 'search') { + const query = message.query; + const apiUrl = `http://127.0.0.1:5001/api/search?q=${encodeURIComponent(query)}`; // Add the http:// protocol to the URL + + console.log(`Searching for: ${query}`); + fetch(apiUrl) + .then(response => response.json()) + .then(data => { + const results = data.results || []; + console.log('Search results:', results); + sendResponse({ results }); + + // Send the results to the popup + chrome.runtime.sendMessage({ action: 'displayResults', results }); + }) + .catch(error => { + console.error('Error fetching search results:', error); + sendResponse({ results: [] }); + }); + + // Return true to indicate that the response will be sent asynchronously + return true; + } +}); + +// Periodically check the active tab's URL every 0.5 seconds +setInterval(() => { + chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { + if (tabs.length > 0) { + const activeTab = tabs[0]; + const url = new URL(activeTab.url); + const hostname = url.hostname; + + // List of supported sites + const supportedSites = [ + 'mangadex.org', + 'anilist.co', + 'kitsu.app', + 'myanimelist.net' + ]; + + if (supportedSites.includes(hostname)) { + console.log(`Sending addLens message to content script for hostname: ${hostname}`); + chrome.tabs.sendMessage(activeTab.id, { action: 'addLens', hostname }); + } + } + }); +}, 500); diff --git a/packages/KomSearcher/content.js b/packages/KomSearcher/content.js new file mode 100644 index 0000000..a70ee2b --- /dev/null +++ b/packages/KomSearcher/content.js @@ -0,0 +1,84 @@ +// Detect the active site and add a magnifying lens in the appropriate location +const siteHandlers = { + 'mangadex.org': () => { + const headers = document.querySelectorAll('div.title p.mb-1'); // Select the text inside p.mb-1 within div.title + headers.forEach(header => addLens(header)); + }, + 'anilist.co': () => { + const headers = document.querySelectorAll('.header-title'); + headers.forEach(header => addLens(header)); + }, + 'kitsu.app': () => { + const headers = document.querySelectorAll('section.media--title h3'); // Select the text inside h3 within section.media--title + headers.forEach(header => addLens(header)); + }, + 'myanimelist.net': () => { + const headers = document.querySelectorAll('.title-name'); + headers.forEach(header => addLens(header)); + } +}; + +function addLens(header) { + // Check if the lens is already present + if (header.querySelector('span.lens-icon')) { + return; // Exit if the lens is already added + } + + const lens = document.createElement('span'); + lens.textContent = '🔍'; + lens.className = 'lens-icon'; // Add a class to identify the lens + lens.style.cursor = 'pointer'; + lens.style.marginLeft = '10px'; + lens.title = 'Search for this title?'; // Add a tooltip to the lens + lens.addEventListener('click', () => { + const query = header.textContent.trim().replace('🔍', '').trim(); // Remove the lens icon from the query + console.log(`Searching for title: ${query}`); + chrome.runtime.sendMessage({ action: 'search', query }, (response) => { + if (response && response.results) { + displayResults(response.results); + } + }); + }); + header.appendChild(lens); +} + +function displayResults(results) { + const resultWindow = document.createElement('div'); + resultWindow.style.position = 'fixed'; + resultWindow.style.top = '10px'; + resultWindow.style.right = '10px'; + resultWindow.style.backgroundColor = 'white'; + resultWindow.style.border = '1px solid black'; + resultWindow.style.padding = '10px'; + resultWindow.style.zIndex = '10000'; + resultWindow.style.maxHeight = '400px'; + resultWindow.style.overflowY = 'auto'; // Make the result window scrollable + + // Ensure results are displayed as titles + resultWindow.innerHTML = results.map(r => `

${r.title || 'No title available'}

`).join(''); + + // Remove any existing result window before appending a new one + const existingWindow = document.querySelector('.result-window'); + if (existingWindow) { + existingWindow.remove(); + } + + resultWindow.className = 'result-window'; + document.body.appendChild(resultWindow); +} + +// Execute the handler for the current site immediately on page load +const hostname = window.location.hostname; +if (siteHandlers[hostname]) { + siteHandlers[hostname](); +} + +// Listen for messages from the background script +chrome.runtime.onMessage.addListener((message) => { + if (message.action === 'addLens') { + const hostname = message.hostname; + if (siteHandlers[hostname]) { + siteHandlers[hostname](); + } + } +}); diff --git a/packages/KomSearcher/icon.png b/packages/KomSearcher/icon.png new file mode 100644 index 0000000..e69de29 diff --git a/packages/KomSearcher/manifest.json b/packages/KomSearcher/manifest.json new file mode 100644 index 0000000..fe037ab --- /dev/null +++ b/packages/KomSearcher/manifest.json @@ -0,0 +1,25 @@ +{ + "manifest_version": 2, + "name": "KomSearcher", + "version": "1.0", + "description": "A Firefox extension used to request manga from various sites.", + "permissions": ["activeTab", "tabs"], + "background": { + "scripts": ["background.js"] + }, + "browser_action": { + "default_icon": "icon.png", + "default_title": "KomSearcher" + }, + "content_scripts": [ + { + "matches": [ + "https://mangadex.org/*", + "https://anilist.co/*", + "https://kitsu.app/*", + "https://myanimelist.net/*" + ], + "js": ["content.js"] + } + ] +} diff --git a/packages/KomSearcher/popup.html b/packages/KomSearcher/popup.html new file mode 100644 index 0000000..200f6ff --- /dev/null +++ b/packages/KomSearcher/popup.html @@ -0,0 +1,62 @@ + + + + + + Search Results + + + +

Search Results

+
+ + + diff --git a/packages/KomSuite-NyaaPy b/packages/KomSuite-NyaaPy new file mode 160000 index 0000000..d29938b --- /dev/null +++ b/packages/KomSuite-NyaaPy @@ -0,0 +1 @@ +Subproject commit d29938bcf59bcf3f35fd060e27423bd7d5a19efc diff --git a/packages/KomTagger b/packages/KomTagger new file mode 160000 index 0000000..7574239 --- /dev/null +++ b/packages/KomTagger @@ -0,0 +1 @@ +Subproject commit 7574239cdb1da54a2f365466a4ab0374c30471c5 diff --git a/packages/KomTaggerTui/README.md b/packages/KomTaggerTui/README.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/KomTaggerTui/pyproject.toml b/packages/KomTaggerTui/pyproject.toml new file mode 100644 index 0000000..0f30a7c --- /dev/null +++ b/packages/KomTaggerTui/pyproject.toml @@ -0,0 +1,19 @@ +[project] +name = "komtaggertui" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +authors = [ + { name = "WorldTeacher", email = "coding_contact@pm.me" } +] +requires-python = ">=3.13" +dependencies = [ + "komtagger", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.uv.sources] +komtagger = { workspace = true } diff --git a/packages/KomTaggerTui/src/komtaggertui/__init__.py b/packages/KomTaggerTui/src/komtaggertui/__init__.py new file mode 100644 index 0000000..7c107b4 --- /dev/null +++ b/packages/KomTaggerTui/src/komtaggertui/__init__.py @@ -0,0 +1,2 @@ +def hello() -> str: + return "Hello from komtaggertui!" diff --git a/packages/KomTaggerTui/src/komtaggertui/app.py b/packages/KomTaggerTui/src/komtaggertui/app.py new file mode 100644 index 0000000..896515c --- /dev/null +++ b/packages/KomTaggerTui/src/komtaggertui/app.py @@ -0,0 +1,3 @@ +from textual.content import Content +from rich.console import RenderableType +from \ No newline at end of file diff --git a/packages/KomTaggerTui/src/komtaggertui/py.typed b/packages/KomTaggerTui/src/komtaggertui/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/packages/anilistAPI b/packages/anilistAPI new file mode 160000 index 0000000..abf482a --- /dev/null +++ b/packages/anilistAPI @@ -0,0 +1 @@ +Subproject commit abf482a7b67311a7110a2688605b45818c39e285 diff --git a/packages/autograbber b/packages/autograbber new file mode 160000 index 0000000..c0b4a8d --- /dev/null +++ b/packages/autograbber @@ -0,0 +1 @@ +Subproject commit c0b4a8d90fd48ceed4338474ca9171f733780ff5 diff --git a/packages/comicvineAPI b/packages/comicvineAPI new file mode 160000 index 0000000..d85576d --- /dev/null +++ b/packages/comicvineAPI @@ -0,0 +1 @@ +Subproject commit d85576d94915230f98bbc17df60389858e15e166 diff --git a/packages/komgAPI b/packages/komgAPI new file mode 160000 index 0000000..1877905 --- /dev/null +++ b/packages/komgAPI @@ -0,0 +1 @@ +Subproject commit 1877905473728a0f553834d78b8d08b2ef7aba77 diff --git a/packages/mangadexAPI/.gitea/ISSUE_TEMPLATE/bug.yml b/packages/mangadexAPI/.gitea/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..8f78e72 --- /dev/null +++ b/packages/mangadexAPI/.gitea/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,34 @@ +name: Bug Report +description: Report a bug in this project +labels: + - kind/bug + - triage +body: + + - type: textarea + id: bug + attributes: + label: Describe the bug + description: | + A clear and concise description of what the bug is. + What did you expect to happen? What happened instead? + Include screenshots if applicable. + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Steps to reproduce + description: | + A clear and concise description of how to reproduce the bug. + Include steps, code snippets, or screenshots if applicable. + validations: + required: true + - type: textarea + id: additional-info + attributes: + label: Additional information + description: | + Add any other context or screenshots about the bug here. + + \ No newline at end of file diff --git a/packages/mangadexAPI/.gitea/ISSUE_TEMPLATE/feature.yml b/packages/mangadexAPI/.gitea/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 0000000..cb6338e --- /dev/null +++ b/packages/mangadexAPI/.gitea/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,23 @@ +name: Feature request +description: Suggest an idea for this project +labels: + - kind/feature + - triage + +body: + - type: textarea + id: feature + attributes: + label: Describe the feature + description: | + A clear and concise description of what the feature is. + What is the problem it solves? What are you trying to accomplish? + Include screenshots if applicable. + validations: + required: true + - type: textarea + id: additional-info + attributes: + label: Additional information + description: | + Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/packages/mangadexAPI/.gitea/workflows/build.yml b/packages/mangadexAPI/.gitea/workflows/build.yml new file mode 100644 index 0000000..8373538 --- /dev/null +++ b/packages/mangadexAPI/.gitea/workflows/build.yml @@ -0,0 +1,88 @@ +on: + workflow_dispatch: + inputs: + release_notes: + description: Release notes (use \n for newlines) + type: string + required: false + github_release: + description: 'Create Gitea Release' + default: true + type: boolean + bump: + description: 'Bump type' + required: true + default: 'patch' + type: choice + options: + - 'major' + - 'minor' + - 'patch' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Set up Python + run: uv python install + - name: Set Git identity + run: | + git config user.name "Gitea CI" + git config user.email "ci@git.theprivateserver.de" + - name: Bump version + id: bump + run: | + uv tool install bump-my-version + uv tool run bump-my-version bump ${{ github.event.inputs.bump }} + # echo the version to github env, the version is shown by using uv tool run bump-my-version show current_version + echo "VERSION<> $GITHUB_ENV + echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + + - name: Add release notes to environment + id: add_release_notes + run: | + echo "RELEASE_NOTES<> $GITHUB_ENV + echo "${{ github.event.inputs.release_notes }}" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: Build package + run: uv build + - name: Publish package + env: + USERNAME: ${{ github.repository_owner }} + run: uv publish --publish-url https://git.theprivateserver.de/api/packages/$USERNAME/pypi/ -t ${{ secrets.TOKEN }} + - name: Generate changelog + id: changelog + uses: metcalfc/changelog-generator@v4.6.2 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + - name: Get the changelog + run: | + cat << "EOF" + ${{ steps.changelog.outputs.changelog }} + EOF + + - name: Create release + id: create_release + if: ${{ github.event.inputs.github_release == 'true' }} + uses: softprops/action-gh-release@master + with: + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} + body: ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: false + make_latest: true + files: | + dist/* + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file diff --git a/packages/mangadexAPI/README.md b/packages/mangadexAPI/README.md new file mode 100644 index 0000000..e69de29 diff --git a/packages/mangadexAPI/pyproject.toml b/packages/mangadexAPI/pyproject.toml new file mode 100644 index 0000000..6955f09 --- /dev/null +++ b/packages/mangadexAPI/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "mangadexapi" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +authors = [ + { name = "WorldTeacher", email = "coding_contact@pm.me" } +] +requires-python = ">=3.13" +dependencies = [] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" diff --git a/packages/mangadexAPI/src/mangadexapi/__init__.py b/packages/mangadexAPI/src/mangadexapi/__init__.py new file mode 100644 index 0000000..cc9ef79 --- /dev/null +++ b/packages/mangadexAPI/src/mangadexapi/__init__.py @@ -0,0 +1,2 @@ +def hello() -> str: + return "Hello from mangadexapi!" diff --git a/packages/mangadexAPI/src/mangadexapi/py.typed b/packages/mangadexAPI/src/mangadexapi/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0ea0447 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "komsuite-web" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.13" +dependencies = []