Xc Api Playlist Link -
Sometimes, you don't need the whole playlist; you just need the direct streaming URL for a specific channel. The XC API allows you to generate a stream link on the fly:
http://SERVER_URL:PORT/YOUR_USER/YOUR_PASS/CHANNEL_ID
Example:
http://myiptv.net:8080/john123/pass456/152.ts
The XC API provides programmatic access to playlist data and management features for XC (an online content platform). This paper examines the structure, access patterns, typical use cases, security considerations, and best practices when working with XC API playlist links.
const crypto = require('crypto');
const axios = require('axios');
app.post('/api/playlist/generate', authenticateUser, async (req, res) =>
try
const xcServer, xcPort, xcUsername, xcPassword, outputFormat = 'm3u', expiresInDays = null = req.body; xc api playlist link
// Validate XC credentials first
const testUrl = `http://$xcServer:$xcPort/player_api.php?username=$xcUsername&password=$xcPassword&action=user_info`;
const testResponse = await axios.get(testUrl);
if (!testResponse.data.user_info)
return res.status(401).json( error: 'Invalid XC credentials' );
// Generate unique linkId
const linkId = crypto.randomBytes(16).toString('hex');
let expiresAt = null;
if (expiresInDays)
expiresAt = new Date();
expiresAt.setDate(expiresAt.getDate() + expiresInDays);
const newLink = await PlaylistLink.create(
userId: req.user.id,
linkId,
xcServer,
xcPort,
xcUsername,
xcPassword,
outputFormat,
expiresAt
);
const generatedLink = `$req.protocol://$req.get('host')/api/playlist/$linkId.$outputFormat`;
res.json( 'never'
);
catch (err)
res.status(500).json( error: err.message );
);
app.delete('/api/playlist/:linkId', authenticateUser, async (req, res) =>
const linkId = req.params;
const result = await PlaylistLink.findOneAndDelete(
linkId,
userId: req.user.id
); Sometimes, you don't need the whole playlist; you
if (!result)
return res.status(404).json( error: 'Link not found or not owned by you' );
res.json( success: true, message: 'Playlist link revoked' );
);
Imagine a user has curated the perfect "Road Trip" mix. They want to send it to a friend. The friend shouldn't have to log in to the user's account to see it.
The goal: Convert a list of track IDs stored in a database into a unique, sharable URL.
Playlists aggregate media items (audio, video) into ordered collections. An API playlist link is a URL or identifier exposed by the XC API that references a playlist resource, enabling retrieval, sharing, embedding, and manipulation via HTTP requests. Example:
http://myiptv