|
@@ -224,7 +224,7 @@ type IgGraphQLTimelineBaseNode = {
|
|
|
{__typename: 'GraphSidecar', edge_sidecar_to_children: {
|
|
|
edges: {node: (IgGraphQLTimelineBaseNode & {__typename: 'GraphImage' | 'GraphVideo'})}[],
|
|
|
}} |
|
|
|
- {__typename: 'GraphVideo', video_url: string, product_type?: 'igtv'}
|
|
|
+ {__typename: 'GraphVideo', video_url: string, product_type?: 'igtv', dash_info?: {video_dash_manifest?: string}}
|
|
|
);
|
|
|
|
|
|
export type IgGraphQLUser = {
|
|
@@ -499,8 +499,16 @@ export default class {
|
|
|
if (!fullName && node.accessibility_caption) {
|
|
|
fullName = node.accessibility_caption.replace(/^Photo by (.+) on \w+ \d+, \d+\..*/, '$1');
|
|
|
}
|
|
|
- // exclude IGTV
|
|
|
- if (node.__typename === 'GraphVideo' && node.product_type === 'igtv') continue;
|
|
|
+ // exclude long videos
|
|
|
+ const isVideoTooLong = (info) => {
|
|
|
+ let manifest: string;
|
|
|
+ if (info && (manifest = info.video_dash_manifest)) {
|
|
|
+ const match = /mediaPresentationDuration="PT(?:(\d+)H)?(?:(\d+)M)?\d+.\d+S"/.exec(manifest);
|
|
|
+ return Number(match[1]) > 0 || Number(match[2]) > 10;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (node.__typename === 'GraphVideo' && isVideoTooLong(node.dash_info)) continue;
|
|
|
// add post if ID is greater than target
|
|
|
if (node.id && BigNumOps.compare(node.id, targetId) > 0) nodes.push(node);
|
|
|
// return of ID is equal to or smaller than target
|