Fix ChromeDriver compatibility and update desktop icon
This commit is contained in:
1 parent
9b63031c1e
commit
5f88cdd92b
2 files changed
+19
-5
No files matched your search
@@ -15,6 +15,12 @@ source "$DIR/.venv/bin/activate"
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install -r "$DIR/requirements.txt"
|
pip install -r "$DIR/requirements.txt"
|
||||||
|
|
||||||
|
# Check if Chromium is installed, install if not
|
||||||
|
if ! command -v chromium-browser > /dev/null 2>&1; then
|
||||||
|
echo "Chromium not found. Installing Chromium..."
|
||||||
|
sudo apt update && sudo apt install -y chromium-browser
|
||||||
|
fi
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
python3 journey_fm_app.py
|
python3 journey_fm_app.py
|
||||||
@@ -9,9 +9,9 @@ creates a playlist of matching songs, and imports it into Plex.
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.firefox.options import Options
|
from selenium.webdriver.chrome.options import Options
|
||||||
from selenium.webdriver.firefox.service import Service
|
from selenium.webdriver.chrome.service import Service
|
||||||
from webdriver_manager.firefox import GeckoDriverManager
|
from webdriver_manager.chrome import ChromeDriverManager
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import os
|
import os
|
||||||
@@ -31,8 +31,16 @@ def scrape_recently_played():
|
|||||||
"""Scrape recently played songs from myjourneyfm.com using Selenium"""
|
"""Scrape recently played songs from myjourneyfm.com using Selenium"""
|
||||||
options = Options()
|
options = Options()
|
||||||
options.add_argument("--headless")
|
options.add_argument("--headless")
|
||||||
service = Service(GeckoDriverManager().install())
|
options.add_argument("--no-sandbox")
|
||||||
driver = webdriver.Firefox(service=service, options=options)
|
options.add_argument("--disable-dev-shm-usage")
|
||||||
|
options.add_argument("--disable-gpu")
|
||||||
|
options.add_argument("--remote-debugging-port=9222")
|
||||||
|
options.add_argument("--user-data-dir=/tmp/chromium")
|
||||||
|
options.add_argument("--no-first-run")
|
||||||
|
options.add_argument("--disable-extensions")
|
||||||
|
options.binary_location = "/usr/bin/chromium-browser"
|
||||||
|
service = Service()
|
||||||
|
driver = webdriver.Chrome(service=service, options=options)
|
||||||
|
|
||||||
url = 'https://www.myjourneyfm.com/recently-played/'
|
url = 'https://www.myjourneyfm.com/recently-played/'
|
||||||
driver.get(url)
|
driver.get(url)
|
||||||
|
|||||||
Reference in new issue
Block a user