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
|
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)
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
@ -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'
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user