made the direct downloads work
This commit is contained in:
		@@ -18,6 +18,15 @@ def search_pages():
 | 
				
			|||||||
    search.choose(0)
 | 
					    search.choose(0)
 | 
				
			||||||
    print(search)
 | 
					    print(search)
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					def direct_download():
 | 
				
			||||||
 | 
					    search = pages.Search()
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    search.search_url("https://www.metal-archives.com/bands/Ghost_Bath/3540372489")
 | 
				
			||||||
 | 
					    print(search)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    search.search_url("https://musify.club/artist/ghost-bath-280348")
 | 
				
			||||||
 | 
					    print(search)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
    music_kraken.cli()
 | 
					    direct_download()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -84,6 +84,9 @@ class Source(DatabaseObject):
 | 
				
			|||||||
        parsed = urlparse(url)
 | 
					        parsed = urlparse(url)
 | 
				
			||||||
        url = parsed.geturl()
 | 
					        url = parsed.geturl()
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        if "musify" in parsed.netloc:
 | 
				
			||||||
 | 
					            return cls(SourcePages.MUSIFY, url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if url.startswith("https://www.youtube"):
 | 
					        if url.startswith("https://www.youtube"):
 | 
				
			||||||
            return cls(SourcePages.YOUTUBE, url)
 | 
					            return cls(SourcePages.YOUTUBE, url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@ from ..musify import Musify
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
NAME_PAGE_MAP: Dict[str, Type[Page]] = dict()
 | 
					NAME_PAGE_MAP: Dict[str, Type[Page]] = dict()
 | 
				
			||||||
PAGE_NAME_MAP: Dict[Type[Page], str] = dict()
 | 
					PAGE_NAME_MAP: Dict[Type[Page], str] = dict()
 | 
				
			||||||
SOURCE_PAGE_MAP: Dict[SourcePages, Type[Page]]
 | 
					SOURCE_PAGE_MAP: Dict[SourcePages, Type[Page]] = dict()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ALL_PAGES: Tuple[Type[Page]] = (
 | 
					ALL_PAGES: Tuple[Type[Page]] = (
 | 
				
			||||||
    EncyclopaediaMetallum,
 | 
					    EncyclopaediaMetallum,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user