webfeed
webfeed copied to clipboard
Please support YouTube Atom feed
YouTube supports the Atom feed for every channel. The below one is just an example and the structure of atom feeds are consistent.
Example: https://www.youtube.com/feeds/videos.xml?channel_id=UCs5wAPodliO0oVxiTD8ruvg
Replace CHANNEL_ID with the channel you want https://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID
I couldn't fetch the info under the <media:group>.
group.dart
import 'package:webfeed/domain/media/category.dart';
import 'package:webfeed/domain/media/content.dart';
import 'package:webfeed/domain/media/credit.dart';
import 'package:webfeed/domain/media/rating.dart';
import 'package:webfeed/domain/media/thumbnail.dart';
import 'package:webfeed/domain/media/title.dart';
import 'package:webfeed/domain/media/description.dart';
import 'package:webfeed/domain/media/community.dart';
import 'package:webfeed/util/xml.dart';
import 'package:xml/xml.dart';
class Group {
final Title? title;
final List<Content>? contents;
final List<Thumbnail>? thumbnails;
final Description? description;
final Community? community;
final List<Credit>? credits;
final Category? category;
final Rating? rating;
Group({
this.title,
this.contents,
this.thumbnails,
this.description,
this.community,
this.credits,
this.category,
this.rating,
});
static parse(XmlElement? element) {
if (element == null) return null;
return Group(
title: Title.parse(
findFirstElement(element, 'media:title'),
),
contents: element.findElements('media:content').map((e) {
return Content.parse(e);
}).toList(),
thumbnails: element.findElements('media:thumbnail').map((e) {
return Thumbnail.parse(e);
}).toList(),
description: Description.parse(
findFirstElement(element, 'media:description'),
),
community: Community.parse(
findFirstElement(element, 'media:community'),
),
credits: element.findElements('media:credit').map((e) {
return Credit.parse(e);
}).toList(),
category: Category.parse(
findFirstElement(element, 'media:category'),
),
rating: Rating.parse(
findFirstElement(element, 'media:rating'),
),
);
}
}
Why does the new group.dart no longer have these elements? How do I add them?