Some linting.

This commit is contained in:
voussoir 2021-08-20 22:59:17 -07:00
parent 21a81fd62c
commit 491992b606
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
9 changed files with 21 additions and 10 deletions

View file

@ -2,3 +2,9 @@ from . import common
from . import endpoints from . import endpoints
site = common.site site = common.site
__all__ = [
'common',
'endpoints',
'site',
]

View file

@ -1,3 +1,9 @@
from . import basic_endpoints from . import basic_endpoints
from . import channel_endpoints from . import channel_endpoints
from . import video_endpoints from . import video_endpoints
__all__ = [
'basic_endpoints',
'channel_endpoints',
'video_endpoints',
]

View file

@ -1,6 +1,5 @@
import flask; from flask import request import flask; from flask import request
import itertools import itertools
import traceback
from voussoirkit import flasktools from voussoirkit import flasktools

View file

@ -1,5 +1,4 @@
import flask; from flask import request import flask; from flask import request
import traceback
from voussoirkit import flasktools from voussoirkit import flasktools

View file

@ -1,6 +1,4 @@
import argparse import argparse
import os
import sqlite3
import sys import sys
import ycdl import ycdl

View file

@ -1,5 +1,4 @@
import argparse import argparse
import os
import sqlite3 import sqlite3
import sys import sys

View file

@ -2,3 +2,10 @@ from . import exceptions
from . import helpers from . import helpers
from . import ycdldb from . import ycdldb
from . import ytapi from . import ytapi
__all__ = [
'exceptions',
'helpers',
'ycdldb',
'ytapi',
]

View file

@ -1,7 +1,5 @@
import json import json
import os
import sqlite3 import sqlite3
import traceback
from . import constants from . import constants
from . import exceptions from . import exceptions

View file

@ -4,8 +4,6 @@ import isodate
from voussoirkit import gentools from voussoirkit import gentools
from voussoirkit import vlogging from voussoirkit import vlogging
from . import helpers
def int_none(x): def int_none(x):
if x is None: if x is None:
return None return None
@ -46,7 +44,8 @@ class Video:
self.comment_count = int_none(statistics.get('commentCount')) self.comment_count = int_none(statistics.get('commentCount'))
thumbnails = snippet['thumbnails'] thumbnails = snippet['thumbnails']
best_thumbnail = max(thumbnails, key=lambda x: thumbnails[x]['width'] * thumbnails[x]['height']) ranker = lambda key: thumbnails[key]['width'] * thumbnails[key]['height']
best_thumbnail = max(thumbnails, key=ranker)
self.thumbnail = thumbnails[best_thumbnail] self.thumbnail = thumbnails[best_thumbnail]
def __str__(self): def __str__(self):