{"id":18474642,"url":"https://github.com/ibizaman/jsondispatch","last_synced_at":"2025-04-08T12:32:18.709Z","repository":{"id":53239617,"uuid":"116364527","full_name":"ibizaman/jsondispatch","owner":"ibizaman","description":"Server program that accepts HTTP requests with a JSON payload and forwards the request to another program after transformation.","archived":false,"fork":false,"pushed_at":"2024-11-18T22:02:47.000Z","size":32,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"aria2_addUri","last_synced_at":"2025-03-23T12:41:32.838Z","etag":null,"topics":["aria2c","chrome-extension","firefox-addon","json-payload","magnet-url","python3"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibizaman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-05T09:00:08.000Z","updated_at":"2024-11-18T22:02:45.000Z","dependencies_parsed_at":"2024-04-30T19:41:13.037Z","dependency_job_id":"05c8a9f0-2c8a-41e7-8368-0554b70c4ac2","html_url":"https://github.com/ibizaman/jsondispatch","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.1428571428571429,"last_synced_commit":"b68a8a68649cf37dc56032216130a5e09f6f7931"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibizaman%2Fjsondispatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibizaman%2Fjsondispatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibizaman%2Fjsondispatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibizaman%2Fjsondispatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibizaman","download_url":"https://codeload.github.com/ibizaman/jsondispatch/tar.gz/refs/heads/aria2_addUri","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247842815,"owners_count":21005351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aria2c","chrome-extension","firefox-addon","json-payload","magnet-url","python3"],"created_at":"2024-11-06T10:30:10.794Z","updated_at":"2025-04-08T12:32:18.332Z","avatar_url":"https://github.com/ibizaman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Table of Contents\n\n1.  [Json Dispatch](#org1ebd606)\n    1.  [Use Cases](#orgd2b20aa)\n        1.  [Send file to aria2 and set download dir based on category](#orgb7f7725)\n    2.  [Install \u0026 Use](#org902adaf)\n        1.  [Server](#org5b297f7)\n        2.  [Browser extension](#orgdb0ace7)\n    3.  [Develop](#orgc64c5ed)\n        1.  [Files Layout](#orgdc9d277)\n    4.  [License](#org80ce1fa)\n\n\n\u003ca id=\"org1ebd606\"\u003e\u003c/a\u003e\n\n# Json Dispatch\n\nServer program written in python that accepts HTTP POST requests with a JSON\npayload and forwards the request to another program, after transforming it in a\nconfigurable way. Quite generic, but that's the goal. See [1.1](#orgd2b20aa) for concrete\nexamples.\n\n`Python 3.6` supported only, although other `Python 3.X` versions should work\ntoo.\n\nAlso provides a Firefox and Chrome extension that talks to the server and allows\nyou to right click on a URL/link in your browser and \"send it to\" the server.\n\n\n\u003ca id=\"orgd2b20aa\"\u003e\u003c/a\u003e\n\n## Use Cases\n\n\n\u003ca id=\"orgb7f7725\"\u003e\u003c/a\u003e\n\n### Send file to aria2 and set download dir based on category\n\nConfig file `/etc/jsondispatch/jsondispatch.conf`:\n\n    cors:\n      domain: '*'\n    \n    commands:\n      aria2:\n        url: http://localhost:6800/jsonrpc\n        rpc_secret: mYs3Cr3t\n    \n    triggers:\n      download_program_uri:\n        - command: aria2\n          method: addUri\n          arguments:\n            url: {url}\n            dir: /srv/backups/programs\n\nJSON payload to send to the server with URL ending with\n`/trigger/download_program_uri` with POST request:\n\n    {\n        \"url\": \"magnet:?xt=urn:btih:204a1789dd04e4d8f5a4e098e8f777794888f4ad\u0026dn=archlinux-2017.12.01-x86_64.iso\u0026tr=udp://tracker.archlinux.org:6969\u0026tr=http://tracker.archlinux.org:6969/announce\"\n    }\n\nWhen sending the above POST request, jsondispatch will call the `addUri` RPC\nmethod of aria2 with the given magnet URL and the hardcoded `dir` argument.\n\nOr just use the browser extension which does this for you with a right click on\na magnet URL (or any link for that matter).\n\n\n\u003ca id=\"org902adaf\"\u003e\u003c/a\u003e\n\n## Install \u0026 Use\n\n\n\u003ca id=\"org5b297f7\"\u003e\u003c/a\u003e\n\n### Server\n\nTo install the server, clone this repo, `cd` in the repo and run:\n\n    pip install -e \".\"\n\nCreate a configuration file in `/etc/jsondispatch/jsondispatch.conf` (by\ndefault, `--config` option lets you setup a custom file location). See [1.1](#orgd2b20aa)\nfor example configurations.\n\nTo run the server, `cd` in the repo and run:\n\n    python . \n\nYou can change the default port and config file location, give the `--help`\nargument for detailed instructions.\n\n\n\u003ca id=\"orgdb0ace7\"\u003e\u003c/a\u003e\n\n### Browser extension\n\nFor Firefox, go to `about:debugging` and click on `Load Temporary Add-On`.\nBrowse to the `browserextension/` folder in this repo and select the\n`manifest.json` file. Now that the addon is added, go to the addons settings\npage `about:addons` and fill-in the server URL.\n\nIf you're running the server locally with default port, then the URL is\n`http://127.0.0.1:8850`.\n\nFor Chrome, go to `chrome://extensions/`, enable `Developer mode`, click on\n`Load unpacked extension`. Browse to the `firefox/` folder in this repo and\nclick on `open`. Now that the addon is added, click on the addon's `option`\nbutton and fill-in the server URL.\n\nNow you can just right click on a link and go in the submenu `Send to Json\nDispatch`, then choose one of the options which correspond to the configured\ntriggers. Of course, first make sure you installed and started the server as\nexplained in [1.2.1](#org5b297f7).\n\n\n\u003ca id=\"orgc64c5ed\"\u003e\u003c/a\u003e\n\n## Develop\n\n    pip install -e \".[dev,test]\"\n\n\n\u003ca id=\"orgdc9d277\"\u003e\u003c/a\u003e\n\n### Files Layout\n\n\n\u003ca id=\"org80ce1fa\"\u003e\u003c/a\u003e\n\n## License\n\nThe icon was taken from \u003chttps://feathericons.com/\u003e, it's under MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibizaman%2Fjsondispatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibizaman%2Fjsondispatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibizaman%2Fjsondispatch/lists"}