Files
YouTube.js/lib/parser/contents/classes/MicroformatData.js
LuanRT 1d62e469a9 refactor: rewrite Comments Section logic (#88)
* feat: add core comments section classes

* chore: update type declarations

* chore: fix linter warnings

* style: fix linter

* chore: update tests

* chore(tests): fix typo

* chore(tests): fix typo x2

* fix(tests): `getReplies()` method is only present in `CommentThread` and not `Comment`

* chore(tests): fix comment id path

* chore(tests): remove outdated code

* chore(tests): fix results path

* chore: enforce code style

* chore: update type declarations

* docs: add examples and documentation

* chore(docs): fix paths

* chore(docs): fix more paths

* chore(docs): fix `Comments.js` path

* chore(docs): fix typo

* chore(docs): mention example file

* chore(examples): fix imports

* chore(examples): fix typo
2022-07-02 19:55:33 -03:00

36 lines
1.2 KiB
JavaScript

'use strict';
const Thumbnail = require('./Thumbnail');
class MicroformatData {
type = 'MicroformatData';
constructor(data) {
this.url_canonical = data.urlCanonical;
this.title = data.title;
this.description = data.description;
this.thumbnail = data.thumbnail && Thumbnail.fromResponse(data.thumbnail);
this.site_name = data.siteName;
this.app_name = data.appName;
this.android_package = data.androidPackage;
this.ios_app_store_id = data.iosAppStoreId;
this.ios_app_arguments = data.iosAppArguments;
this.og_type = data.ogType;
this.url_applinks_web = data.urlApplinksWeb;
this.url_applinks_ios = data.urlApplinksIos;
this.url_applinks_android = data.urlApplinksAndroid;
this.url_twitter_ios = data.urlTwitterIos;
this.url_twitter_android = data.urlTwitterAndroid;
this.twitter_card_type = data.twitterCardType;
this.twitter_site_handle = data.twitterSiteHandle;
this.schema_dot_org_type = data.schemaDotOrgType;
this.noindex = data.noindex;
this.is_unlisted = data.unlisted;
this.is_family_safe = data.familySafe;
this.tags = data.tags;
this.available_countries = data.availableCountries;
// XXX: linkAlternatives?
}
}
module.exports = MicroformatData;