How to use the ytmdl.cache.main function in ytmdl

To help you get started, we’ve selected a few ytmdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deepjyoti30 / ytmdl / View on Github external
# Check if --setup is passed
    if args.setup:

    # After this part song name is required
    if song_name is None:
        print("Please pass a song name. This is necessary",
              "to search metadata.")

    if not args.nolocal:
        # Search for the song locally
        if not cache.main(song_name):
            return 0

    is_quiet = args.quiet
    url = args.url

    # If the url is passed then get the data
    if url is not None:
        data = []
        # Get video data from youtube
        temp_data = yt.scan_video(yt.get_href(url))

        # link to dw the song
        link = url

        # In this case choice will be 0