Stdout problem struggling + add access_token to gitignore

This commit is contained in:
2025-12-07 15:22:15 +02:00
parent bc243e73eb
commit 5cc1fc1e9e
4 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.cache .cache
access_token.txt
# Devenv # Devenv
.devenv* .devenv*

View File

@@ -5,4 +5,5 @@
/nix/store/dzz1xf4nxx8v42pz5sxxx62r0jjpl0qf-craftcerts-script: line 5: 2: command not found /nix/store/dzz1xf4nxx8v42pz5sxxx62r0jjpl0qf-craftcerts-script: line 5: 2: command not found
req: Extra option: "1" req: Extra option: "1"
req: Use -help for summary. req: Use -help for summary.
- [ ] Make geturl.py needs to return playlist URL to the program - [ ] Make geturl.py return playlist URL to the program
Currently hangs and returns nothing to stdout + returns flask stdout bullshit

View File

@@ -8,10 +8,14 @@ import time
import requests import requests
from datetime import datetime from datetime import datetime
import subprocess import subprocess
import logging
app = Flask(__name__) app = Flask(__name__)
stop_flask = threading.Event() stop_flask = threading.Event()
logger = logging.getLogger('flask')
logger.setLevel(logging.ERROR) # Set to ERROR to ignore lower levels
client_id = "c0020cc0e05245efb2ddb61b7045e4f2" client_id = "c0020cc0e05245efb2ddb61b7045e4f2"
client_secret = "2e2e7c98f849403fbacc219c1f01c17d" client_secret = "2e2e7c98f849403fbacc219c1f01c17d"
redirect_uri = "https://elease-uncapsuled-yosef.ngrok-free.dev/callback" # Hardcoded ngrok URL redirect_uri = "https://elease-uncapsuled-yosef.ngrok-free.dev/callback" # Hardcoded ngrok URL
@@ -86,8 +90,8 @@ def create_playlist():
def run_flask(): def run_flask():
with open(os.devnull, 'w') as fnull: with open(os.devnull, 'w') as fnull:
# Redirect both stdout and stderr to devnull # Redirect both stdout and stderr to devnull
sys.stdout = fnull #sys.stdout = fnull
sys.stderr = fnull sys.stderr = fnull # COMMENT FOR DEBUG
subprocess.run(["xdg-open", "http://192.168.0.100:8888"]) subprocess.run(["xdg-open", "http://192.168.0.100:8888"])
app.run(host="0.0.0.0", port=8888, use_reloader=False) app.run(host="0.0.0.0", port=8888, use_reloader=False)
# sys.stdout = sys.__stdout__ # Restore original stdout # sys.stdout = sys.__stdout__ # Restore original stdout

View File

@@ -0,0 +1,2 @@
* Serving Flask app 'geturl'
* Debug mode: off