11import { INodeProperties } from 'n8n-workflow' ;
22import { ScraperApiParams } from '../types' ;
3+ import { Utils } from './utils' ;
34import {
45 TargetProperty ,
56 UrlProperty ,
@@ -13,6 +14,8 @@ import {
1314 VideoIdProperty ,
1415 TranscriptOriginProperty ,
1516 LanguageCodeProperty ,
17+ SubredditProperty ,
18+ RedditSortProperty ,
1619} from '../properties' ;
1720
1821export class PropertyHandler {
@@ -21,6 +24,7 @@ export class PropertyHandler {
2124 UrlProperty . property ,
2225 QueryProperty . property ,
2326 VideoIdProperty . property ,
27+ SubredditProperty . property ,
2428 HeadlessProperty . property ,
2529 ParseProperty . property ,
2630 TranscriptOriginProperty . property ,
@@ -29,6 +33,7 @@ export class PropertyHandler {
2933 LocaleProperty . property ,
3034 LimitProperty . property ,
3135 MarkdownProperty . property ,
36+ RedditSortProperty . property ,
3237 ] ;
3338
3439 static getParameters = (
@@ -49,6 +54,7 @@ export class PropertyHandler {
4954 return {
5055 target : params . target ,
5156 ...( params . url && { url : params . url } ) ,
57+ ...( params . subreddit && { url : Utils . getSubredditUrl ( params . subreddit , params . reddit_sort ) } ) ,
5258 ...( params . query && { query : params . query } ) ,
5359 ...( params . video_id && { query : params . video_id } ) ,
5460 ...( params . headless && { headless : 'html' } ) ,
0 commit comments