#!/usr/bin/env npx tsx
/**
* Script one-off para remover "Bonde do Brunão" da playlist Bruno Mars - BRL
*/
import dotenv from 'dotenv';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
dotenv.config({ path: path.join(__dirname, '../../.env') });
import { SpotifyAuth } from '../auth/spotify-auth.js';
import { SpotifyTools } from '../tools/spotify-tools.js';
import type { SpotifyConfig } from '../types/index.js';
const config: SpotifyConfig = {
clientId: process.env.SPOTIFY_CLIENT_ID || '',
clientSecret: process.env.SPOTIFY_CLIENT_SECRET || '',
redirectUri: process.env.SPOTIFY_REDIRECT_URI || 'http://localhost:3000/callback',
};
const PLAYLIST_ID = '7HNvuotbKnA6pMEyYWz1aq';
const TRACK_ID_BONDE_DO_BRUNAO = '4mOWnjz30frv1pKMM6DNfv';
async function main() {
const auth = new SpotifyAuth(config);
const tools = new SpotifyTools(auth);
const result = await tools.removeTracksFromPlaylist(PLAYLIST_ID, [TRACK_ID_BONDE_DO_BRUNAO]);
const text = result.content[0]?.type === 'text' ? result.content[0].text : JSON.stringify(result);
console.log(text);
}
main().catch((err) => {
console.error(err);
process.exit(1);
});