diff --git a/music_kraken/download/page_attributes.py b/music_kraken/download/page_attributes.py index f37517e..8b433b1 100644 --- a/music_kraken/download/page_attributes.py +++ b/music_kraken/download/page_attributes.py @@ -109,15 +109,24 @@ class Pages: if page is None: return None + # getting the appropriate function for the page and the object type source_type = page.get_source_type(source) if not hasattr(page, fetch_map[source_type]): return None - func = getattr(page, fetch_map[source_type])(source=source, **kwargs) + + # fetching the data object and marking it as fetched data_object: DataObject = func(source=source) data_object.mark_as_fetched(source.hash_url) return data_object + def fetch_from_url(self, url: str) -> Optional[DataObject]: + source = Source.match_url(url, SourcePages.MANUAL) + if source is None: + return None + + return self.fetch_from_source(source=source) + def is_downloadable(self, music_object: DataObject) -> bool: _page_types = set(self._source_to_page) for src in music_object.source_collection.source_pages: