Skip to content

Commit

Permalink
Add a user agent for rss
Browse files Browse the repository at this point in the history
  • Loading branch information
zoriya committed Aug 10, 2024
1 parent ad355c5 commit 404d8c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/models/FeedReader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FeedSub, {FeedItem} from 'feedsub';
import Miniget from "miniget";

export interface FeedReaderOptions {
feedID: string;
Expand Down Expand Up @@ -48,6 +49,12 @@ class FeedReader {
};

initReader() {
// Assign a user agent for rss that require one
Miniget.defaultOptions = Object.assign(Miniget.defaultOptions, {
headers: {
"User-Agent": "flood",
}
});
this.reader = new FeedSub(this.options.url, {
autoStart: true,
emitOnStart: true,
Expand Down

0 comments on commit 404d8c7

Please sign in to comment.