2019-05-27 15:53:14 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2020-03-28 07:54:04 +00:00
|
|
|
# Copyright (C) 2019-2020 A S Lewis
|
2019-05-27 15:53:14 +01:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU General Public License as published by the Free Software
|
|
|
|
# Foundation, either version 3 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 General Public License for more
|
|
|
|
# details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along with
|
|
|
|
# this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
"""Standard python setup file."""
|
|
|
|
|
|
|
|
|
|
|
|
# Import modules
|
2020-02-23 16:53:45 +00:00
|
|
|
import glob
|
2019-08-14 13:15:39 +01:00
|
|
|
import os
|
2019-05-28 14:48:25 +01:00
|
|
|
import setuptools
|
2019-08-14 13:15:39 +01:00
|
|
|
import sys
|
2019-05-27 15:53:14 +01:00
|
|
|
|
2020-03-03 13:53:12 +00:00
|
|
|
# Set a standard long_description, modified only for Debian/RPM packages
|
|
|
|
long_description="""
|
2020-03-28 07:54:04 +00:00
|
|
|
Tartube is a GUI front-end for youtube-dl, partly based on youtube-dl-gui
|
|
|
|
and written in Python 3 / Gtk 3.
|
|
|
|
|
|
|
|
- You can download individual videos, and even whole channels and
|
|
|
|
playlists, from YouTube and hundreds of other websites
|
|
|
|
- You can fetch information about those videos, channels and playlists,
|
|
|
|
without actually downloading anything
|
|
|
|
- Tartube will organise your videos into convenient folders
|
|
|
|
- If creators upload their videos to more than one website (YouTube and
|
|
|
|
BitChute, for example), you can download videos from both sites without
|
|
|
|
creating duplicates
|
|
|
|
- Certain popular websites manipulate search results, repeatedly
|
|
|
|
unsubscribe people from their favourite channels and/or deliberately
|
|
|
|
conceal videos that they don't like. Tartube won't do any of those things
|
|
|
|
- Tartube can, in some circumstances, see videos that are region-blocked
|
|
|
|
and/or age-restricted
|
|
|
|
"""
|
|
|
|
|
|
|
|
alt_description = """
|
|
|
|
Tartube is a GUI front-end for youtube-dl, partly based on youtube-dl-gui
|
|
|
|
and written in Python 3 / Gtk 3.
|
2020-03-03 13:53:12 +00:00
|
|
|
"""
|
2019-05-27 15:53:14 +01:00
|
|
|
|
2020-02-28 16:06:16 +00:00
|
|
|
# data_files for setuptools.setup are added here
|
|
|
|
param_list = []
|
|
|
|
|
2020-03-28 07:54:04 +00:00
|
|
|
# For Debian/RPM packaging, use environment variables
|
|
|
|
# For example, the package maintainer might use either of the following:
|
|
|
|
# TARTUBE_PKG=1 python3 setup.py build
|
|
|
|
# TARTUBE_PKG_STRICT=1 python3 setup.py build
|
|
|
|
# (Specifying both variables is the same as specifying TARTUBE_PKG_STRICT
|
|
|
|
# alone)
|
|
|
|
#
|
|
|
|
# There are three executables: the default one in ../tartube, and two
|
|
|
|
# alternative ones in ../pack/bin and ../pack/bin_strict
|
|
|
|
# If TARTUBE_PKG_STRICT is specified, then ../pack/bin_strict/tartube is the
|
|
|
|
# executable, which means that youtube-dl updates are disabled. Also, icon
|
|
|
|
# files are copied into /usr/share/tartube/icons
|
|
|
|
pkg_strict_var = 'TARTUBE_PKG_STRICT'
|
|
|
|
pkg_strict_value = os.environ.get( pkg_strict_var, None )
|
|
|
|
script_exec = os.path.join('tartube', 'tartube')
|
2020-02-29 13:27:43 +00:00
|
|
|
icon_path = '/tartube/icons/'
|
2020-05-07 08:45:06 +01:00
|
|
|
sound_path = '/tartube/sounds/'
|
2020-03-28 07:35:24 +00:00
|
|
|
pkg_flag = False
|
2020-03-28 07:54:04 +00:00
|
|
|
|
|
|
|
if pkg_strict_value is not None:
|
|
|
|
|
|
|
|
if pkg_strict_value == '1':
|
|
|
|
script_exec = os.path.join('pack', 'bin_strict', 'tartube')
|
|
|
|
sys.stderr.write('youtube-dl updates are disabled in this version\n')
|
|
|
|
pkg_flag = True
|
|
|
|
|
|
|
|
else:
|
|
|
|
sys.stderr.write(
|
|
|
|
"Unrecognised '%s=%s' environment variable!\n" % (
|
|
|
|
pkg_strict_var,
|
|
|
|
pkg_strict_value,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
# If TARTUBE_PKG is specified, then ../pack/bin/tartube is the executable,
|
|
|
|
# which means that youtube-dl updates are enabled. Also, icon files are
|
|
|
|
# copied into /usr/share/tartube/icons
|
2020-02-28 16:06:16 +00:00
|
|
|
pkg_var = 'TARTUBE_PKG'
|
|
|
|
pkg_value = os.environ.get( pkg_var, None )
|
|
|
|
|
|
|
|
if pkg_value is not None:
|
|
|
|
|
|
|
|
if pkg_value == '1':
|
2020-03-28 07:54:04 +00:00
|
|
|
script_exec = os.path.join('pack', 'bin', 'tartube')
|
|
|
|
pkg_flag = True
|
2019-08-14 13:15:39 +01:00
|
|
|
|
|
|
|
else:
|
|
|
|
sys.stderr.write(
|
|
|
|
"Unrecognised '%s=%s' environment variable!\n" % (
|
2020-02-28 16:06:16 +00:00
|
|
|
pkg_var,
|
|
|
|
pkg_value,
|
2019-08-14 13:15:39 +01:00
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2020-03-28 07:54:04 +00:00
|
|
|
# Apply changes if either environment variable was specified
|
|
|
|
if pkg_flag:
|
|
|
|
|
2020-05-07 08:45:06 +01:00
|
|
|
# Icons/sounds must be copied into the right place
|
2020-03-28 07:54:04 +00:00
|
|
|
icon_path = '/usr/share/tartube/icons/'
|
2020-05-07 08:45:06 +01:00
|
|
|
sound_path = '/usr/share/tartube/sounds/'
|
2020-03-28 07:54:04 +00:00
|
|
|
# Use a shorter long description, as the standard one tends to cause errors
|
|
|
|
long_description = alt_description
|
|
|
|
# Add a desktop file
|
|
|
|
param_list.append(('share/applications', ['pack/tartube.desktop']))
|
|
|
|
param_list.append(('share/pixmaps', ['pack/tartube.png']))
|
|
|
|
param_list.append(('share/pixmaps', ['pack/tartube.xpm']))
|
|
|
|
# Add a manpage
|
|
|
|
param_list.append(('share/man/man1', ['pack/tartube.1']))
|
|
|
|
|
2020-02-28 16:06:16 +00:00
|
|
|
# For PyPI installations and Debian/RPM packaging, copy everything in ../icons
|
2020-05-07 08:45:06 +01:00
|
|
|
# and ../sounds into a suitable location
|
2020-03-28 07:54:04 +00:00
|
|
|
subdir_list = [
|
|
|
|
'dialogue',
|
|
|
|
'large',
|
|
|
|
'locale',
|
|
|
|
'small',
|
|
|
|
'status',
|
|
|
|
'toolbar',
|
|
|
|
'win',
|
|
|
|
]
|
|
|
|
|
2020-02-28 16:06:16 +00:00
|
|
|
for subdir in subdir_list:
|
|
|
|
for path in glob.glob('icons/' + subdir + '/*'):
|
|
|
|
param_list.append((icon_path + subdir + '/', [path]))
|
2019-08-18 11:36:04 +01:00
|
|
|
|
2020-05-07 08:45:06 +01:00
|
|
|
for path in glob.glob('sounds/*'):
|
|
|
|
param_list.append((icon_path + '/', [path]))
|
|
|
|
|
2019-05-27 15:53:14 +01:00
|
|
|
# Setup
|
2019-05-28 14:48:25 +01:00
|
|
|
setuptools.setup(
|
2020-03-28 07:54:04 +00:00
|
|
|
name='tartube',
|
2020-08-13 15:39:25 +01:00
|
|
|
version='2.1.080',
|
2020-03-28 07:54:04 +00:00
|
|
|
description='GUI front-end for youtube-dl',
|
2020-03-03 13:53:12 +00:00
|
|
|
long_description=long_description,
|
|
|
|
long_description_content_type='text/plain',
|
2020-03-28 07:54:04 +00:00
|
|
|
url='https://tartube.sourceforge.io',
|
2019-05-27 15:53:14 +01:00
|
|
|
author='A S Lewis',
|
|
|
|
author_email='aslewis@cpan.org',
|
2019-05-28 14:48:25 +01:00
|
|
|
# license=license,
|
2020-02-28 16:06:16 +00:00
|
|
|
license="""GPLv3+""",
|
2019-07-04 17:42:11 +01:00
|
|
|
classifiers=[
|
2020-03-28 07:54:04 +00:00
|
|
|
'Development Status :: 5 - Production/Stable',
|
2019-07-04 17:42:11 +01:00
|
|
|
'Intended Audience :: End Users/Desktop',
|
2020-03-28 07:54:04 +00:00
|
|
|
'Topic :: Multimedia :: Video',
|
2019-07-04 17:42:11 +01:00
|
|
|
'License :: OSI Approved' \
|
|
|
|
+ ' :: GNU General Public License v3 or later (GPLv3+)',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
|
|
|
'Programming Language :: Python :: 3.6',
|
|
|
|
'Programming Language :: Python :: 3.7',
|
|
|
|
],
|
2020-03-28 07:54:04 +00:00
|
|
|
keywords='tartube video download youtube',
|
2019-07-04 17:42:11 +01:00
|
|
|
packages=setuptools.find_packages(
|
2020-03-28 07:54:04 +00:00
|
|
|
exclude=('docs', 'icons', 'nsis', 'tests'),
|
2019-07-04 17:42:11 +01:00
|
|
|
),
|
2019-08-19 11:03:26 +01:00
|
|
|
include_package_data=True,
|
2019-07-04 17:42:11 +01:00
|
|
|
python_requires='>=3.0, <4',
|
2020-07-04 13:30:46 +01:00
|
|
|
install_requires=['feedparser', 'pgi', 'playsound', 'requests'],
|
2019-08-18 16:10:47 +02:00
|
|
|
scripts=[script_exec],
|
2019-07-04 17:42:11 +01:00
|
|
|
project_urls={
|
2020-03-28 07:54:04 +00:00
|
|
|
'Bug Reports': 'https://github.com/axcore/tartube/issues',
|
|
|
|
'Source': 'https://github.com/axcore/tartube',
|
2019-07-04 17:42:11 +01:00
|
|
|
},
|
2020-02-28 16:06:16 +00:00
|
|
|
data_files=param_list,
|
2019-05-27 15:53:14 +01:00
|
|
|
)
|