# Path: dbcollection/core/exceptions.py
# class GoogleDriveFileIdDoesNotExist(Exception):
#     """Google drive's file id does not exist."""
#     pass
# 
# class InvalidURLDownloadSource(Exception):
#     """The url source is invalid/undefined."""
#     pass
# 
# class MD5HashNotEqual(Exception):
#     """The MD5 hashes are not equal."""
#     pass
# 
# class URLDoesNotExist(Exception):
#     """URL path does not exist."""
#     pass


import os
import hashlib
import shutil
import tempfile
import requests
import patoolib
import progressbar
from dbcollection.core.exceptions import (
    GoogleDriveFileIdDoesNotExist,
    InvalidURLDownloadSource,
    MD5HashNotEqual,
    URLDoesNotExist,
)
        str
            URL file name.

        """
        url_metadata = URL().parse_url_metadata(url)
        return url_metadata['filename']


class URLDownload:
    """Download an URL using the requests module."""

    def download(self, url, filename, verbose=False):
        """Downloads an url data and stores it into a file.

        Parameters
        ----------
        url : str
            URL location.
        filename : str
            File name + path to store the downloaded data to disk.
        verbose : bool, optional
            Display progress bar

        Raises
        ------
        URLDoesNotExist
            If an URL is invalid/does not exist.

        """
        if not self.check_exists_url(url):

# Path: dbcollection/core/exceptions.py
# class GoogleDriveFileIdDoesNotExist(Exception):
#     """Google drive's file id does not exist."""
#     pass
# 
# class InvalidURLDownloadSource(Exception):
#     """The url source is invalid/undefined."""
#     pass
# 
# class MD5HashNotEqual(Exception):
#     """The MD5 hashes are not equal."""
#     pass
# 
# class URLDoesNotExist(Exception):
#     """URL path does not exist."""
#     pass


# Path: dbcollection/utils/url.py
import os
import hashlib
import shutil
import tempfile
import requests
import patoolib
import progressbar
from dbcollection.core.exceptions import (
    GoogleDriveFileIdDoesNotExist,
    InvalidURLDownloadSource,
    MD5HashNotEqual,
    URLDoesNotExist,
)

        str
            URL file name.

        """
        url_metadata = URL().parse_url_metadata(url)
        return url_metadata['filename']


class URLDownload:
    """Download an URL using the requests module."""

    def download(self, url, filename, verbose=False):
        """Downloads an url data and stores it into a file.

        Parameters
        ----------
        url : str
            URL location.
        filename : str
            File name + path to store the downloaded data to disk.
        verbose : bool, optional
            Display progress bar

        Raises
        ------
        URLDoesNotExist
            If an URL is invalid/does not exist.

        """
        if not self.check_exists_url(url):

            raise URLDoesNotExist("Invalid url or does not exist: {}".format(url))