Skip to content

Commit

Permalink
Merge pull request #56 from giantpinkrobots/next
Browse files Browse the repository at this point in the history
Merging next into main for v2024.2.29
  • Loading branch information
giantpinkrobots authored Feb 29, 2024
2 parents 813aeac + f811086 commit 51fb79a
Show file tree
Hide file tree
Showing 28 changed files with 1,534 additions and 956 deletions.
Binary file added browser-extension/arrow-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions browser-extension/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
chrome.downloads.onCreated.addListener(function(downloadItem) {
chrome.storage.sync.get('enabled', function(data) {
if (data.enabled) {
sendToAria2(downloadItem);
}
});
});

function sendToAria2(downloadItem) {
fetch('http://localhost:6801/jsonrpc', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'aria2.addUri',
params: [[downloadItem.url]]
})
}).then(response => {
chrome.downloads.cancel(downloadItem.id);
}).catch(error => {

});
}
Binary file added browser-extension/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added browser-extension/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added browser-extension/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added browser-extension/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions browser-extension/manifest-chromium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Varia Integrator",
"description": "Route all downloads to Varia if it's running.",
"version": "1.0",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"action": {
"default_popup": "popup.html"
},
"permissions": ["downloads", "storage"],
"host_permissions": ["http://localhost:6801/jsonrpc"],
"manifest_version": 3,
"background": {
"service_worker": "background.js"
}
}

23 changes: 23 additions & 0 deletions browser-extension/manifest-firefox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Varia Integrator",
"description": "Route all downloads to Varia if it's running.",
"version": "1.0",
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"browser_action": {
"default_popup": "popup.html"
},
"permissions": ["downloads", "storage", "<all_urls>"],
"manifest_version": 2,
"background": {
"scripts": ["background.js"]
},
"browser_specific_settings": {
"gecko": {
"id": "[email protected]"
}
}
}
86 changes: 86 additions & 0 deletions browser-extension/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
width: 200px;
height: 125px;
background-color: #f6f5f4;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.with-drop-shadow {
filter: drop-shadow(rgb(122, 122, 122) 0rem 0rem 5px);
}
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .15s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .15s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #2196F3;
}
input:checked + .slider:before {
transform: translateX(26px);
}
@media (prefers-color-scheme: dark) {
body {
background-color: #242424;
}
.with-drop-shadow {
filter: drop-shadow(rgb(39, 39, 39) 0rem 0rem 5px);
}
.feather-icons {
filter: invert(100%);
}
}
</style>
</head>
<body>
<center>
<br>
<div style="display: flex; justify-content: center; align-items: center;">
<img class="feather-icons with-drop-shadow"; src="download.png">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img class="feather-icons"; src="arrow-right.png">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img class="with-drop-shadow"; src="icon48.png">
</div>
<br>
<label class="switch">
<input type="checkbox" id="toggleSwitch">
<span class="slider"></span>
</label>
<br>
</center>
<script src="popup.js"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions browser-extension/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document.addEventListener('DOMContentLoaded', function () {
var toggleSwitch = document.getElementById('toggleSwitch');
chrome.storage.sync.get('enabled', function(data) {
toggleSwitch.checked = data.enabled;
});
toggleSwitch.addEventListener('change', function () {
var enabled = this.checked;
chrome.storage.sync.set({enabled: enabled});
});
});
4 changes: 0 additions & 4 deletions io.github.giantpinkrobots.varia.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"buildsystem" : "autotools",
"config-opts": [
"--without-libxml2",
"--without-libexpat",
"--without-sqlite3",
"--without-appletls",
"--without-gnutls",
Expand All @@ -42,13 +41,10 @@
"--without-cppunit",
"--without-libz",
"--without-libcunit",
"--without-libssl",
"--without-libuv",
"--without-libcares",
"--without-libaria2",
"--disable-nls",
"--with-openssl",
"--disable-bittorrent",
"--disable-ftp"
],
"sources" : [
Expand Down
24 changes: 24 additions & 0 deletions po/Varia.pot
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,30 @@ msgstr ""
msgid "Failed to open directory."
msgstr ""

msgid "Remote Mode"
msgstr ""

msgid "Remote aria2 IP"
msgstr ""

msgid "Remote aria2 Port"
msgstr ""

msgid "Remote aria2 RPC Secret"
msgstr ""

msgid "Remote Download Location"
msgstr ""

msgid "Exiting Varia..."
msgstr ""

msgid "Background Mode"
msgstr ""

msgid "Continuing the downloads in the background."
msgstr ""

#: src/gtk/help-overlay.ui:11
msgctxt "shortcut window"
msgid "General"
Expand Down
24 changes: 24 additions & 0 deletions po/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,30 @@ msgstr "Yetkilendirme başarısız oldu."
msgid "Failed to open directory."
msgstr "Dizin açılamadı."

msgid "Remote Mode"
msgstr "Uzaktan Kontrol Modu"

msgid "Remote aria2 IP"
msgstr "Uzak aria2 IP'si"

msgid "Remote aria2 Port"
msgstr "Uzak aria2 Port'u"

msgid "Remote aria2 RPC Secret"
msgstr "Uzak aria2 RPC Şifresi"

msgid "Remote Download Location"
msgstr "Uzak İndirme Dizini"

msgid "Exiting Varia..."
msgstr "Varia'dan çıkılıyor..."

msgid "Background Mode"
msgstr "Arka Plan Modu"

msgid "Continuing the downloads in the background."
msgstr "İndirmeler arka planda devam ediyor."

#: src/gtk/help-overlay.ui:11
msgctxt "shortcut window"
msgid "General"
Expand Down
25 changes: 10 additions & 15 deletions python3-aria2p.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1b/2e/e1eba62ca72501efa07002f816e065849b4c26cc212f9c623d72e74993a0/aria2p-0.11.3-py3-none-any.whl",
"sha256": "bc0fbe71de360e01e3db4301c89052799e7c4f004ab62fdbaa6bc96d20f476da"
"url": "https://files.pythonhosted.org/packages/9a/56/a1ba3e0fe737b9b20a45c10266ab88a0f44e5779fa751a7484259d8845ea/aria2p-0.12.0-py3-none-any.whl",
"sha256": "476171257cdd8d74d888bcb983ecba5e9db19c2d8ecf9ef22547f88080b7bea8"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/64/62/428ef076be88fa93716b576e4a01f919d25968913e817077a386fcbe4f42/certifi-2023.11.17-py3-none-any.whl",
"sha256": "e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474"
"url": "https://files.pythonhosted.org/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl",
"sha256": "dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"
},
{
"type": "file",
Expand All @@ -27,8 +27,8 @@
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl",
"sha256": "90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
"url": "https://files.pythonhosted.org/packages/c2/e7/a82b05cf63a603df6e68d59ae6a68bf5064484a0718ea5033660af4b54a9/idna-3.6-py3-none-any.whl",
"sha256": "c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"
},
{
"type": "file",
Expand All @@ -42,18 +42,13 @@
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl",
"sha256": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"
"url": "https://files.pythonhosted.org/packages/a2/73/a68704750a7679d0b6d3ad7aa8d4da8e14e151ae82e6fee774e6e0d05ec8/urllib3-2.2.1-py3-none-any.whl",
"sha256": "450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/96/94/c31f58c7a7f470d5665935262ebd7455c7e4c7782eb525658d3dbf4b9403/urllib3-2.1.0-py3-none-any.whl",
"sha256": "55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/c4/3c/1892ce394828c43d4f65248ebdee3854114266b75d1f5915cb211155ad7b/websocket_client-1.6.4-py3-none-any.whl",
"sha256": "084072e0a7f5f347ef2ac3d8698a5e0b4ffbfcab607628cadabc650fc9a83a24"
"url": "https://files.pythonhosted.org/packages/1e/70/1e88138a9afbed1d37093b85f0bebc3011623c4f47c166431599fe9d6c93/websocket_client-1.7.0-py3-none-any.whl",
"sha256": "f4c3d22fec12a2461427a29957ff07d35098ee2d976d3ba244e688b8b4057588"
}
]
}
Loading

0 comments on commit 51fb79a

Please sign in to comment.