Skip to content

Commit

Permalink
V4.0: Better wording on Youtube API Key Quota limits, handle SingInts (
Browse files Browse the repository at this point in the history
…#71)

* add test, handle Youtube quota expiry better (#68)

* add sigint handler to handle Ctrl+C better

* major version bump due to Python version change (now needs 3.6+)

* move sentry around so that github action doesn;t complain when trying to fetch version for publishing

* move sentry around

* oops, moved signal to wrong place
  • Loading branch information
SathyaBhat authored Mar 29, 2020
1 parent c8451ac commit 2e5b427
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ So I wrote this script which mimics that library, but instead of downloading fro

### How do I get this thing running?

Pre-requisite: You need Python 3+
Pre-requisite: You need Python 3.6+

1. Install using pip
`sudo pip3 install spotify_dl`
Expand Down
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#!/usr/bin/env python

from setuptools import setup, find_packages
from spotify_dl.constants import VERSION

with open('README.md') as f:
long_description = f.read()

with open('requirements.txt') as f:
requirements = f.read().splitlines()

version = '3.5.0'

setup(
name='spotify_dl',
version=version,
version=VERSION,
python_requires='>=3',
install_requires=requirements,
author='Sathya Bhat',
Expand All @@ -38,9 +37,9 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Internet',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
Expand Down
10 changes: 10 additions & 0 deletions spotify_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import signal
import sys

def signal_handler(sig, frame):
# Signal handler to handle SIGINT, usually when Ctrl+C is pressed.. or if SIGINT is sent.
# Thanks to https://stackoverflow.com/a/1112350/92837
print('\nCaught interrupt(did you press Ctrl+C?), stopping spotify_dl')
sys.exit(0)

signal.signal(signal.SIGINT, signal_handler)
5 changes: 1 addition & 4 deletions spotify_dl/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
YOUTUBE_API_VERSION = "v3"
VIDEO = 'youtube#video'
YOUTUBE_VIDEO_URL = 'https://www.youtube.com/watch?v='
VERSION = '3.5.0'

import sentry_sdk
sentry_sdk.init("https://7d74a39472c9449dac51eb24bb33bdc3@sentry.io/2383261")
VERSION = '4.0.0'
2 changes: 2 additions & 0 deletions spotify_dl/scaffold.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
from os import getenv
import sentry_sdk

__all__ = ['log', 'check_for_tokens']

Expand All @@ -8,6 +9,7 @@
' %(funcName)s - %(message)s')

log = logging.getLogger('sdl')
sentry_sdk.init("https://7d74a39472c9449dac51eb24bb33bdc3@sentry.io/2383261")


def check_for_tokens():
Expand Down

0 comments on commit 2e5b427

Please sign in to comment.