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
import metadata.download
import metadata.search
import download_links
import url_to_path
import download
from .metadata.download import MetadataDownloader
from .metadata import download
from .metadata import search as s
from . import download_links
from . import url_to_path
from . import download
# NEEDS REFACTORING
from lyrics_ import fetch_lyrics
from .lyrics_ import fetch_lyrics
import logging
import os
@ -34,7 +34,7 @@ def get_existing_genre():
def search_for_metadata():
search = metadata.search.Search()
search = s.Search()
while True:
input_ = input(
@ -107,4 +107,4 @@ def cli(start_at: int = 0, only_lyrics: bool = False):
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 pydub import AudioSegment
from src.utils.shared import *
from src.scraping import musify, youtube_music
from .utils.shared import *
from .scraping import musify, youtube_music
"""
https://en.wikipedia.org/wiki/ID3

View File

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

View File

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

View File

@ -1,10 +1,10 @@
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 src.utils.shared import *
from .lyrics import genius
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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