Browse Source

ytdl: remove custom Python

pull/191/head
Rémi Denis-Courmont 5 months ago
parent
commit
3960585e5b
  1. 2
      share/Makefile.am
  2. 46
      share/ytdl-extract.py

2
share/Makefile.am

@ -104,8 +104,6 @@ nobase_dist_pkgdata_SCRIPTS = \
utils/audio-vlc-default.sh \
utils/video-vlc-default.sh \
$(NULL)
dist_pkgdata_SCRIPTS = ytdl-extract.py
endif
EXTRA_DIST += \

46
share/ytdl-extract.py

@ -1,46 +0,0 @@
#! /usr/bin/python3
#
# Copyright (C) 2020 Rémi Denis-Courmont
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
import sys
import json
import yt_dlp
class logger(object):
def debug(self, msg):
pass
def warning(self, msg):
pass
def error(self, msg):
sys.stderr.write(msg + '\n')
def url_extract(url):
opts = {
'extract_flat': 'in_playlist',
'logger': logger(),
}
dl = yt_dlp.YoutubeDL(opts)
# Process a given URL
infos = dl.extract_info(url, download=False)
print(json.dumps(dl.sanitize_info(infos)))
url = sys.argv[1]
url_extract(url)
Loading…
Cancel
Save