LilyAsFlora / reddit-fetch

A simple wrapper for fetching information from reddit posts.
MIT License
6 stars 2 forks source link

allowVideo: false does not work #50

Open GoogolGenius opened 2 years ago

GoogolGenius commented 2 years ago

Explain the Problem: Setting allowVideo: false still retrieves subreddit posts with post.is_video.

To Reproduce: Example code below:

const redditFetch = require('reddit-fetch');

redditFetch({

    subreddit: 'memes', // r/memes subreddit
    sort: 'hot',
    allowNSFW: false,
    allowModPost: true,
    allowCrossPost: true,
    allowVideo: false // videos are set to false

}).then(post => {
    console.table(post);
});

Expected Behavior: Should only retrieve posts without video attachments.

Screenshots: console-allow-Video-false-reddit-fetch-npm.png

Desktop:

Additional Context Currently running on Replit Online IDE.

ddugovic commented 2 years ago

On r/shogi I observe something similar (a link to a video):

...
  media: {
    type: 'youtube.com',
    oembed: {
      provider_url: 'https://www.youtube.com/',
      version: '1.0',
      title: '🐏 SHOGI TIME!! With Karolina-sensei!!! (Mostly EN Stream) 【Vtuber Indonesia】',
      type: 'video',
      thumbnail_width: 480,
      height: 200,
      width: 356,
      html: '<iframe width="356" height="200" src="https://www.youtube.com/embed/gN0psEmU5rI?feature=oembed&enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen title="🐏 SHOGI TIME!! With Karolina-sensei!!! (Mostly EN Stream) 【Vtuber Indonesia】"></iframe>',
      author_name: 'Aika Meru 〘 Yume Reality 〙',
      provider_name: 'YouTube',
      thumbnail_url: 'https://i.ytimg.com/vi/gN0psEmU5rI/hqdefault.jpg',
      thumbnail_height: 360,
      author_url: 'https://www.youtube.com/c/AikaMeru'
    }
  },
  is_video: false
...