Skip to content

Commit

Permalink
LinkDown v0.2
Browse files Browse the repository at this point in the history
Push Source Code of LinkDown v0.2 and LinkDown for Browsers
  • Loading branch information
TakumiBC committed May 13, 2023
1 parent ff2b148 commit e1519d2
Show file tree
Hide file tree
Showing 46 changed files with 2,943 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

custom: https://bank.hackclub.com/donations/start/linkscape
custom: https://linkscape.app/donate
File renamed without changes.
10 changes: 0 additions & 10 deletions ContextSearch-webext/Chrome/contextsearch_webext.json

This file was deleted.

10 changes: 0 additions & 10 deletions ContextSearch-webext/Chromium/contextsearch_webext.json

This file was deleted.

2 changes: 0 additions & 2 deletions ContextSearch-webext/ContextSearch.bat

This file was deleted.

138 changes: 0 additions & 138 deletions ContextSearch-webext/ContextSearch.py

This file was deleted.

10 changes: 0 additions & 10 deletions ContextSearch-webext/Edge/contextsearch_webext.json

This file was deleted.

9 changes: 0 additions & 9 deletions ContextSearch-webext/Firefox/contextsearch_webext.json

This file was deleted.

10 changes: 0 additions & 10 deletions ContextSearch-webext/Vivaldi/contextsearch_webext.json

This file was deleted.

9 changes: 9 additions & 0 deletions LinkDown/chrome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "linkdown",
"description": "Launches external video download softwares",
"type": "stdio",
"allowed_origins": [
"chrome-extension://lnckamlbboggdkkgnkaocibpnilhemhc/"
],
"path": "nativehost.bat"
}
9 changes: 9 additions & 0 deletions LinkDown/firefox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "linkdown",
"description": "Launches external video download softwares",
"type": "stdio",
"allowed_extensions": [
"[email protected]"
],
"path": "nativehost.bat"
}
Binary file removed LinkDown/lux.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions LinkDown/nativehost.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
python -u nativehost.py
37 changes: 37 additions & 0 deletions LinkDown/nativehost.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import json
import subprocess
import sys

# Read a message from stdin and decode it
def read_message():
raw_length = sys.stdin.buffer.read(4)
if not raw_length:
sys.exit(0)
message_length = int.from_bytes(raw_length, byteorder='little')
message = sys.stdin.buffer.read(message_length).decode('utf-8')
return json.loads(message)

# Encode a message and send it to stdout
def send_message(message):
encoded_message = json.dumps(message).encode('utf-8')
encoded_length = len(encoded_message).to_bytes(4, byteorder='little')
sys.stdout.buffer.write(encoded_length)
sys.stdout.buffer.write(encoded_message)
sys.stdout.buffer.flush()

# Main loop
while True:
# Read a message from stdin
message = read_message()

# Check if the message contains a command
if 'command' not in message:
send_message({'error': 'No command specified'})
continue

# Execute the command using subprocess
try:
output = subprocess.check_output(message['command'], shell=True, stderr=subprocess.STDOUT)
send_message({'output': output.decode('utf-8')})
except subprocess.CalledProcessError as e:
send_message({'error': e.output.decode('utf-8')})
Binary file modified LinkDown/yt-dlp.exe
Binary file not shown.
11 changes: 5 additions & 6 deletions LinkDown_Wizard.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "LinkDown"
#define MyAppVersion "0.1.1"
#define MyAppVersion "0.2"
#define MyAppPublisher "LinkScape"

[Setup]
Expand All @@ -13,7 +13,7 @@ AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DefaultDirName={autopf}\LinkScape\{#MyAppName}
DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
Expand All @@ -33,7 +33,7 @@ Name: modifypath; Description: Add LinkDown to PATH; Flags: checkablealone

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "chinesesimplified"; MessagesFile: "{src}\Languages\ChineseSimplified.isl"
Name: "chinesesimplified"; MessagesFile: "ChineseSimplified.isl"

[Code]
const
Expand All @@ -49,9 +49,8 @@ end;
[Files]
Source: "LinkDown\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "ContextSearch-webext\*"; DestDir: "{userappdata}\ContextSearch-webext"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Registry]
Root: HKCR; Subkey: "Software\Mozilla\NativeMessagingHosts\contextsearch_webext"; ValueType: String; ValueData: "{userappdata}\ContextSearch-webext\Firefox\contextsearch_webext.json"; MinVersion: 0.0,6.0;
Root: HKCR; Subkey: "Software\Google\Chrome\NativeMessagingHosts\contextsearch_webext"; ValueType: String; ValueData: "{userappdata}\ContextSearch-webext\Chrome\contextsearch_webext.json"; MinVersion: 0.0,6.0;
Root: HKCU; Subkey: "Software\Mozilla\NativeMessagingHosts\linkdown"; ValueType: String; ValueData: "{app}\firefox.json"; MinVersion: 0.0,6.0;
Root: HKCU; Subkey: "Software\Google\Chrome\NativeMessagingHosts\linkdown"; ValueType: String; ValueData: "{app}\chrome.json"; MinVersion: 0.0,6.0;
Loading

0 comments on commit e1519d2

Please sign in to comment.