-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push Source Code of LinkDown v0.2 and LinkDown for Browsers
- Loading branch information
Showing
46 changed files
with
2,943 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
python -u nativehost.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.