Results 1 to 5 of 5

Thread: Import songs from Shazam to Youtube

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2013
    Posts
    108

    Import songs from Shazam to Youtube

    Lately I felt the need to import songs from Shazam to Youtube. Few years ago, before apple bought Shazam, was possible to auto-sync it, but now there is no option to do it. I thought it would be really useful to create a simple tool to grab all the songs from my Shazam and import them into a Youtube Playlist. To try to achieve this, the only tool that Shazam offer is a csv file, which opened into a viewer, it doesn't seems to display in a good way the traces titles and artist.

    Endeed a screen from shazam

    Name:  Immagine 2022-08-17 213412.jpg
Views: 575
Size:  12.3 KB

    is displayed like this into a csv viewer

    Name:  Immagine 2022-08-17 213338.jpg
Views: 437
Size:  22.9 KB

    which is quite confused. I'm thinking to go through the hard way which means to scrap the page and get the titles if they are not obtainable through the csv file. After that, I thought I could use the Youtube Api - Insert where I can specify the title of the song to add to a specific playlist. Now, apart from the code, do you have any suggestion or thought about it? Would it be possible to make it? Thanks

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Import songs from Shazam to Youtube

    The data looks messed up because it is. It's arbitrarily breaking fields in the middle when it shouldn't. Like it's using a space rather than the commas it should be. Are you opening the file in Excel (or something like it) or is it doing that for you automatically? If you're the one opening it, I'd open it in Notepad, or some text editor, and remove that first line "Shazam Library" ... I think that may be throwing things off.

    Cell A:1 is even showing the first 6 field headers all in one cell. That's telling me that it's not using commas to split the text up, and is using something else.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2013
    Posts
    108

    Re: Import songs from Shazam to Youtube

    I'm using https://www.convertcsv.com/csv-viewer-editor.htm and I am now using the field separator Colon - , which is cleaning the things a bit more, but I think I don't relly like how Shazam creates the csv files. Look
    Attachment 185531 I mean, I don't need date and the " https" at the end.. I don't know if you know Shazam, but on the Shazam app, it offer an embed youtube video for each song shazamed, but on the csv file it only gives back the title and some weird tag..
    p.s. on the second row, it says "Index,TagTime,Title,Artist,URL,TrackKey" which it doesn't correspond to the truth everytime.. Atleast, for the "https" and track key it doesn't return any parameter.

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Import songs from Shazam to Youtube

    Yeah, don't yse a viewer is what I'm trying to say. It's jacking with the presentation of hte data... just download it and open it in something like notepads, Notepad++, or even in VSCode ... something that isn't going to try and parse it. Dollars to donuts you will find the data you're looking for. Once you confirm the data is there, use something like the TextFieldParse for reading in the rows and parsing the fields out properly. It's able to deal with CSV data and even when it's got texxt qualifier which are the quote marks.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2013
    Posts
    108

    Re: Import songs from Shazam to Youtube

    It would be easier to me to use Notepad++ but now I'm trying to figure it out how to get the output as title - artist by using a regex.


    Edit: I made it, I had to search with .*"(.*)","(.*)".* and replace with \1 - \2

    Now I got all the data I've been looking to clean the csv.
    Now I have to make the step number 2, using the YouTube API in order to add to a playlist the first song searched ..
    This is a really hard step to me, cause I never proceed using this kind of loop.
    Using a big list of titles - artist, I should be able to seaarch it, grab the first result id, add it to a known playlist and keep returning to the list to grab the second result and so on.
    Which method should I use? Thanks
    Last edited by matty95srk; Aug 17th, 2022 at 05:38 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width