diff --git a/api/app.py b/api/app.py index 3676572..bf5b252 100644 --- a/api/app.py +++ b/api/app.py @@ -70,6 +70,9 @@ def api_feed(): feed_type=feed_type ) + encoded_url = urllib.parse.quote(url, safe="") + selected_feed = f"{base_url}/feed/{feed_type}/{encoded_url}" + discord_result = None discord_webhook_url = data.get('discord_webhook_url', '').strip() if discord_webhook_url: @@ -84,6 +87,8 @@ def api_feed(): return Response(json.dumps({ 'youtube_rss': youtube_rss, + 'selected_feed': selected_feed, + 'feed_type': feed_type, 'channel_id': channel_id, 'channel_name': channel_name, 'atom_feed': atom_feed, diff --git a/api/index.html b/api/index.html index dbfd3e2..e896cf2 100644 --- a/api/index.html +++ b/api/index.html @@ -217,9 +217,9 @@

YouTube RSS Scanner

html += '

Channel ID: ' + data.channel_id + '

'; html += ''; - html += '
YouTube RSS:
'; - html += ''; - html += '
'; + html += '
Selected RSS Feed:
'; + html += ''; + html += '
'; if (data.api_endpoints && Object.keys(data.api_endpoints).length > 0) { html += '
API Endpoints:
'; diff --git a/index.html b/index.html index f37dfd4..24afd29 100644 --- a/index.html +++ b/index.html @@ -245,18 +245,18 @@

YouTube RSS Scanner

const feedLabel = document.createElement('div'); feedLabel.className = 'feed-label'; - feedLabel.textContent = 'YouTube RSS:'; + feedLabel.textContent = 'Selected RSS Feed:'; feedRow.appendChild(feedLabel); const feedLink = document.createElement('div'); feedLink.className = 'feed-link'; - feedLink.textContent = data.youtube_rss; + feedLink.textContent = (data.selected_feed || data.youtube_rss); feedRow.appendChild(feedLink); const copyBtn = document.createElement('button'); copyBtn.className = 'copy-btn'; - copyBtn.textContent = 'Copy YouTube RSS'; - copyBtn.addEventListener('click', () => copyText(data.youtube_rss)); + copyBtn.textContent = 'Copy Selected RSS'; + copyBtn.addEventListener('click', () => copyText((data.selected_feed || data.youtube_rss))); feedRow.appendChild(copyBtn); resultDiv.appendChild(feedRow); diff --git a/rss_scanner.py b/rss_scanner.py index b34c37a..c4ad151 100644 --- a/rss_scanner.py +++ b/rss_scanner.py @@ -298,8 +298,8 @@ def get_rss_feed(url: str, include_api_endpoints: bool = False, base_url: str = """ channel_id, channel_name = extract_channel_id(url) - # YouTube's native RSS URL (mostly broken but included for reference) - youtube_rss = YOUTUBE_RSS_TEMPLATE.format(channel_id=channel_id) + # YouTube RSS URL (supports hidden filtered variants for shorts/live) + youtube_rss = build_youtube_feed_url(channel_id, feed_type=feed_type) # Try to get videos from the selected YouTube channel page videos = get_channel_videos(channel_id, feed_type=feed_type) diff --git a/templates/index.html b/templates/index.html index 1562df7..0d6c3d7 100644 --- a/templates/index.html +++ b/templates/index.html @@ -211,9 +211,9 @@

YouTube RSS Scanner

html += '

Channel ID: ' + data.channel_id + '

'; html += '
'; - html += '
YouTube RSS:
'; - html += ''; - html += '
'; + html += '
Selected RSS Feed:
'; + html += ''; + html += '
'; if (data.api_endpoints && Object.keys(data.api_endpoints).length > 0) { html += '
API Endpoints:
';