KBVE / kbve

KBVE Monorepo
https://kbve.com/
11 stars 11 forks source link

[MUSIC] : Porter Robinson - Mirror #2120

Closed h0lybyte closed 4 months ago

h0lybyte commented 4 months ago

Music Suggestion Form

YouTube Link: https://www.youtube.com/watch?v=l0Jo-9aqhYc Title: Porter Robinson - Mirror Genre: edm

Hint: Only genres that are acceptable are: dnb, chillstep, lofihiphop, nujazz, electroswing, edm, rock, jrock, studybeats, anime

github-actions[bot] commented 4 months ago

[DEBUG] Processing Music Action v0.0.10

github-actions[bot] commented 4 months ago

Atlas Music Response:

{
  "id": "chatcmpl-a6d712ca-0be3-45e0-82bc-b85d4dd62130",
  "object": "chat.completion",
  "created": 1719120980,
  "model": "mixtral-8x7b-32768",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "To create a JSON output for the given dataset, follow these steps:\n\n1. Prompt the user to enter a song title with the band/artist within the title.\n2. Provide a list of specified genres and ask the user to select one.\n3. Request a YouTube link from the user and extract the YouTube ID.\n4. Generate a JSON output containing the required keys and values.\n\nHere's a Python script to do that:\n\n```python\n# Import necessary libraries\nimport re\nimport json\n\n# Define acceptable genres\ngenres = {\n    \"dnb\": \"dnb\",\n    \"chillstep\": \"chillstep\",\n    \"lofihiphop\": \"lofihiphop\",\n    \"nujazz\": \"nujazz\",\n    \"electroswing\": \"electroswing\",\n    \"edm\": \"edm\",\n    \"rock\": \"rock\",\n    \"jrock\": \"jrock\",\n    \"studybeats\": \"studybeats\",\n    \"anime\": \"anime\"\n}\n\n# Prompt user for input\ntitle_artist = input(\"Enter the song title with the band/artist: \")\ngenre = input(\"Select a genre from the following: dnb, chillstep, lofihiphop, nujazz, electroswing, edm, rock, jrock, studybeats, anime: \")\nyoutube_link = input(\"Enter a YouTube link: \")\n\n# Extract YouTube ID from the link\nyoutube_id = re.search(r\"v=([-\\w]+)\", youtube_link).group(1)\n\n# Create a JSON object\noutput = {\n    \"title\": title_artist,\n    \"genre\": genres.get(genre.lower()),\n    \"youtube_id\": youtube_id\n}\n\n# Print the JSON object\nprint(json.dumps(output, indent=2))\n```\n\nAssuming the user provides the input as follows:\n\n```\ntitle_artist: \"Porter Robinson - Mirror\"\ngenre: \"edm\"\nyoutube_link: https://www.youtube.com/watch?v=l0Jo9aqhYcn\n```\n\nThe output will be:\n\n```json\n{\n  \"title\": \"Porter Robinson - Mirror\",\n  \"genre\": \"edm\",\n  \"youtube_id\": \"l0Jo9aqhYcn\"\n}\n```"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 385,
    "prompt_time": 0.062478536,
    "completion_tokens": 568,
    "completion_time": 0.884630337,
    "total_tokens": 953,
    "total_time": 0.947108873
  },
  "system_fingerprint": "fp_c5f20b5bb1",
  "x_groq": {
    "id": "req_01j11sgs4qewd940nse0zg2sbj"
  }
}
github-actions[bot] commented 4 months ago

Dear Lord Commander:

To create a JSON output for the given dataset, follow these steps:

1. Prompt the user to enter a song title with the band/artist within the title.
2. Provide a list of specified genres and ask the user to select one.
3. Request a YouTube link from the user and extract the YouTube ID.
4. Generate a JSON output containing the required keys and values.

Here's a Python script to do that:

```python
# Import necessary libraries
import re
import json

# Define acceptable genres
genres = {
    "dnb": "dnb",
    "chillstep": "chillstep",
    "lofihiphop": "lofihiphop",
    "nujazz": "nujazz",
    "electroswing": "electroswing",
    "edm": "edm",
    "rock": "rock",
    "jrock": "jrock",
    "studybeats": "studybeats",
    "anime": "anime"
}

# Prompt user for input
title_artist = input("Enter the song title with the band/artist: ")
genre = input("Select a genre from the following: dnb, chillstep, lofihiphop, nujazz, electroswing, edm, rock, jrock, studybeats, anime: ")
youtube_link = input("Enter a YouTube link: ")

# Extract YouTube ID from the link
youtube_id = re.search(r"v=([-\w]+)", youtube_link).group(1)

# Create a JSON object
output = {
    "title": title_artist,
    "genre": genres.get(genre.lower()),
    "youtube_id": youtube_id
}

# Print the JSON object
print(json.dumps(output, indent=2))

Assuming the user provides the input as follows:

title_artist: "Porter Robinson - Mirror"
genre: "edm"
youtube_link: https://www.youtube.com/watch?v=l0Jo9aqhYcn

The output will be:

{
  "title": "Porter Robinson - Mirror",
  "genre": "edm",
  "youtube_id": "l0Jo9aqhYcn"
}

Extracted Song Information:
```json
{
  "title": "Porter Robinson - Mirror",
  "genre": "edm",
  "youtube_id": "l0Jo9aqhYcn"
}