Skip to content

Commit

Permalink
Merge pull request #1840 from schwingm/youtube-dl-to-yt-dlp
Browse files Browse the repository at this point in the history
Youtube dl to yt dlp
  • Loading branch information
nicomiguelino authored Dec 27, 2023
2 parents 4170486 + add0579 commit b109dc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ def url_fails(url):

def download_video_from_youtube(uri, asset_id):
home = getenv('HOME')
name = check_output(['youtube-dl', '-e', uri])
info = json.loads(check_output(['youtube-dl', '-j', uri]))
name = check_output(['yt-dlp', '-O', 'title', uri])
info = json.loads(check_output(['yt-dlp', '-j', uri]))
duration = info['duration']

location = path.join(home, 'screenly_assets', asset_id)
Expand All @@ -320,7 +320,7 @@ def __init__(self, location, uri, asset_id):

def run(self):
publisher = ZmqPublisher.get_instance()
call(['youtube-dl', '-f', 'mp4', '-o', self.location, self.uri])
call(['yt-dlp', '-f', 'mp4', '-o', self.location, self.uri])
with db.conn(settings['database']) as conn:
update(conn, self.asset_id, {'asset_id': self.asset_id, 'is_processing': 0})

Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pydbus==0.6.0
pyOpenSSL==19.1.0
python-dateutil==2.8.1
pytz==2022.2.1
PyYAML==5.4
PyYAML==6.0.1
pyzmq==19.0.2
redis==3.5.3
requests[security]==2.27.1
Expand All @@ -39,4 +39,4 @@ six==1.15.0
urllib3==1.26.5
Werkzeug==1.0.1
wheel==0.38.1
youtube-dl>=2021.12.17
yt-dlp==2023.11.16
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def append_usb_assets(mountpoint):
for root, _, filenames in walk(mountpoint):
if 'usb_assets_key.yaml' in filenames:
with open("%s/%s" % (root, 'usb_assets_key.yaml'), 'r') as yaml_file:
usb_file_settings = yaml.load(yaml_file).get('screenly')
usb_file_settings = yaml.load(yaml_file, Loader=yaml.Loader).get('screenly')
if usb_file_settings.get('key') == settings['usb_assets_key']:
if usb_file_settings.get('activate'):
usb_assets_settings.update({
Expand Down

0 comments on commit b109dc1

Please sign in to comment.