refactored imports

This commit is contained in:
Lars Noack 2022-11-14 12:32:31 +01:00
parent 7d09a2a715
commit f955ccdbe6
13 changed files with 32 additions and 33 deletions

View File

@ -1 +0,0 @@
__name__ = "music downloader"

View File

@ -1,14 +1,14 @@
from utils.shared import * from .utils.shared import *
from metadata.download import MetadataDownloader from .metadata.download import MetadataDownloader
import metadata.download from .metadata import download
import metadata.search from .metadata import search as s
import download_links from . import download_links
import url_to_path from . import url_to_path
import download from . import download
# NEEDS REFACTORING # NEEDS REFACTORING
from lyrics_ import fetch_lyrics from .lyrics_ import fetch_lyrics
import logging import logging
import os import os
@ -34,7 +34,7 @@ def get_existing_genre():
def search_for_metadata(): def search_for_metadata():
search = metadata.search.Search() search = s.Search()
while True: while True:
input_ = input( input_ = input(
@ -107,4 +107,4 @@ def cli(start_at: int = 0, only_lyrics: bool = False):
if __name__ == "__main__": if __name__ == "__main__":
cli(start_at=3, only_lyrics=False) cli(start_at=0, only_lyrics=False)

View File

@ -4,8 +4,8 @@ import os.path
from mutagen.easyid3 import EasyID3 from mutagen.easyid3 import EasyID3
from pydub import AudioSegment from pydub import AudioSegment
from src.utils.shared import * from .utils.shared import *
from src.scraping import musify, youtube_music from .scraping import musify, youtube_music
""" """
https://en.wikipedia.org/wiki/ID3 https://en.wikipedia.org/wiki/ID3

View File

@ -1,7 +1,7 @@
import requests import requests
from src.utils.shared import * from .utils.shared import *
from src.scraping import musify, youtube_music, file_system from .scraping import musify, youtube_music, file_system
logger = URL_DOWNLOAD_LOGGER logger = URL_DOWNLOAD_LOGGER

View File

@ -3,9 +3,9 @@ from typing import List
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
import pycountry import pycountry
from src.utils.shared import * from ..utils.shared import *
from src.utils import phonetic_compares from ..utils import phonetic_compares
from src.utils.object_handeling import get_elem_from_obj from ..utils.object_handeling import get_elem_from_obj
# search doesn't support isrc # search doesn't support isrc
# https://genius.com/api/search/multi?q=I Prevail - Breaking Down # https://genius.com/api/search/multi?q=I Prevail - Breaking Down

View File

@ -1,10 +1,10 @@
from mutagen.id3 import ID3, USLT from mutagen.id3 import ID3, USLT
from metadata import database as db from .metadata import database as db
from src.utils.shared import * from .utils.shared import *
from lyrics import genius from .lyrics import genius
from src.utils.shared import * from .utils.shared import *
""" """
This whole Part is bodgy as hell and I need to rewrite this little file urgently. genius.py is really clean though :3 This whole Part is bodgy as hell and I need to rewrite this little file urgently. genius.py is really clean though :3

View File

@ -1,5 +1,5 @@
from src.utils.shared import * from ..utils.shared import *
from src.utils.object_handeling import get_elem_from_obj, parse_music_brainz_date from ..utils.object_handeling import get_elem_from_obj, parse_music_brainz_date
from typing import List from typing import List
import musicbrainzngs import musicbrainzngs

View File

@ -1,8 +1,8 @@
from typing import List from typing import List
import musicbrainzngs import musicbrainzngs
from src.utils.shared import * from ..utils.shared import *
from src.utils.object_handeling import get_elem_from_obj, parse_music_brainz_date from ..utils.object_handeling import get_elem_from_obj, parse_music_brainz_date
logger = SEARCH_LOGGER logger = SEARCH_LOGGER

View File

@ -1,7 +1,7 @@
import os import os
from src.utils.shared import * from ..utils.shared import *
from src.utils import phonetic_compares from ..utils import phonetic_compares
def is_valid(a1, a2, t1, t2) -> bool: def is_valid(a1, a2, t1, t2) -> bool:

View File

@ -4,8 +4,8 @@ import time
import requests import requests
import bs4 import bs4
from src.utils.shared import * from ..utils.shared import *
from src.utils import phonetic_compares from ..utils import phonetic_compares
TRIES = 5 TRIES = 5
TIMEOUT = 10 TIMEOUT = 10

View File

@ -4,7 +4,7 @@ import youtube_dl
import logging import logging
import time import time
from src.utils import phonetic_compares from ..utils import phonetic_compares
YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'} YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'}
YOUTUBE_URL_KEY = 'webpage_url' YOUTUBE_URL_KEY = 'webpage_url'

View File

@ -1,7 +1,7 @@
import os.path import os.path
import logging import logging
from src.utils.shared import * from .utils.shared import *
logger = PATH_LOGGER logger = PATH_LOGGER

View File

@ -3,7 +3,7 @@ import logging
import tempfile import tempfile
import os import os
from src.metadata.database import Database from ..metadata.database import Database
TEMP_FOLDER = "music-downloader" TEMP_FOLDER = "music-downloader"
LOG_FILE = "download_logs.log" LOG_FILE = "download_logs.log"