refactored imports
This commit is contained in:
parent
7d09a2a715
commit
f955ccdbe6
@ -1 +0,0 @@
|
||||
__name__ = "music downloader"
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import os.path
|
||||
import logging
|
||||
|
||||
from src.utils.shared import *
|
||||
from .utils.shared import *
|
||||
|
||||
logger = PATH_LOGGER
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user