podverse-parser 5.1.12 → 5.1.13-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"loggerService.d.ts","sourceRoot":"","sources":["../../src/factories/loggerService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAGzE,eAAO,MAAM,aAAa,eAGxB,CAAC"}
1
+ {"version":3,"file":"loggerService.d.ts","sourceRoot":"","sources":["../../src/factories/loggerService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAGzE,eAAO,MAAM,aAAa,eAExB,CAAC"}
@@ -4,6 +4,5 @@ exports.loggerService = void 0;
4
4
  const logger_1 = require("podverse-helpers/dist/lib/backend/logger");
5
5
  const config_1 = require("../config");
6
6
  exports.loggerService = new logger_1.LoggerService({
7
- logDir: config_1.config.log.dir,
8
7
  logLevel: config_1.config.log.level,
9
8
  });
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/lib/rss/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAIxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;AAiC3D,eAAO,MAAM,kBAAkB,GAAU,KAAK,MAAM,wBAUnD,CAAC;AAQF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACtC,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,2BAA2B,CAAC;CAClD,CAAA;AAED,eAAO,MAAM,6BAA6B,GACxC,KAAK,MAAM,EACX,kBAAkB,MAAM,EACxB,SAAS,oCAAoC;;;;;;EA0I9C,CAAC"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/lib/rss/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAKxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;AAiC3D,eAAO,MAAM,kBAAkB,GAAU,KAAK,MAAM,wBAUnD,CAAC;AAQF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACtC,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,2BAA2B,CAAC;CAClD,CAAA;AAgBD,eAAO,MAAM,6BAA6B,GACxC,KAAK,MAAM,EACX,kBAAkB,MAAM,EACxB,SAAS,oCAAoC;;;;;;EA4I9C,CAAC"}
@@ -42,6 +42,20 @@ const getAndParseRSSFeed = (url) => __awaiter(void 0, void 0, void 0, function*
42
42
  return parsedFeed;
43
43
  });
44
44
  exports.getAndParseRSSFeed = getAndParseRSSFeed;
45
+ // Handle request delay for specific domains to avoid rate limiting
46
+ function handleRateLimitRequestDelay(url) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const delayConfig = [
49
+ { regex: /^https?:\/\/(www\.)?wavlake\.com/, delay: 5000 },
50
+ ];
51
+ for (const { regex, delay } of delayConfig) {
52
+ if (regex.test(url)) {
53
+ yield (0, podverse_helpers_1.sleep)(delay);
54
+ break;
55
+ }
56
+ }
57
+ });
58
+ }
45
59
  const parseRSSFeedAndSaveToDatabase = (url, podcast_index_id, options) => __awaiter(void 0, void 0, void 0, function* () {
46
60
  const { onDemandParserEvent } = options;
47
61
  const onDemandParserEventService = new podverse_orm_1.OnDemandParserEventService();
@@ -72,6 +86,7 @@ const parseRSSFeedAndSaveToDatabase = (url, podcast_index_id, options) => __awai
72
86
  if (!url || !podcast_index_id) {
73
87
  throw new Error(`parseRSSFeedAndSaveToDatabase: url or podcast_index_id is missing for ${url} ${podcast_index_id}`);
74
88
  }
89
+ yield handleRateLimitRequestDelay(url);
75
90
  loggerService_1.loggerService.info(`parseRSSFeedAndSaveToDatabase url: ${url} podcast_index_id: ${podcast_index_id}`);
76
91
  feed = yield (0, feed_1.handleGetRSSFeed)(url, podcast_index_id);
77
92
  if (!(0, podverse_orm_1.checkIfFeedFlagStatusShouldParse)(feed.feed_flag_status.id)) {
@@ -1 +1 @@
1
- {"version":3,"file":"remoteItemParser.d.ts","sourceRoot":"","sources":["../../../src/lib/rss/remoteItemParser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAUR,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAQnF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0BAA0B,EAAE,MAAM,CAAC;CACpC,CAAA;AAeD,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,oCAAoC,CAAC;CAC/C,CAAA;AA6DD,eAAO,MAAM,+BAA+B,GAAU,SAAS,OAAO,EAAE,QAAQ,8BAA8B,KAAG,OAAO,CAAC,uBAAuB,EAAE,CAWjJ,CAAC"}
1
+ {"version":3,"file":"remoteItemParser.d.ts","sourceRoot":"","sources":["../../../src/lib/rss/remoteItemParser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAUR,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAQnF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0BAA0B,EAAE,MAAM,CAAC;CACpC,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,oCAAoC,CAAC;CAC/C,CAAA;AA4DD,eAAO,MAAM,+BAA+B,GAAU,SAAS,OAAO,EAAE,QAAQ,8BAA8B,KAAG,OAAO,CAAC,uBAAuB,EAAE,CAWjJ,CAAC"}
@@ -14,19 +14,6 @@ const podverse_helpers_1 = require("podverse-helpers");
14
14
  const podverse_orm_1 = require("podverse-orm");
15
15
  const podcastIndex_1 = require("@parser/factories/podcastIndex");
16
16
  const loggerService_1 = require("@parser/factories/loggerService");
17
- function handleRequestDelay(url) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- const delayConfig = [
20
- { regex: /^https?:\/\/(www\.)?wavlake\.com/, delay: 5000 },
21
- ];
22
- for (const { regex, delay } of delayConfig) {
23
- if (regex.test(url)) {
24
- yield (0, podverse_helpers_1.sleep)(delay);
25
- break;
26
- }
27
- }
28
- });
29
- }
30
17
  const handleRemoteItemsFeedParsing = (feedGuidsToParse, params) => __awaiter(void 0, void 0, void 0, function* () {
31
18
  var _a, _b;
32
19
  const { accountId, remoteParentPodcastIndexId } = params;
@@ -60,7 +47,6 @@ const handleRemoteItemsFeedParsing = (feedGuidsToParse, params) => __awaiter(voi
60
47
  podcast_index_id: piFeedData.id
61
48
  });
62
49
  if (!feed) {
63
- yield handleRequestDelay(piFeedData.url);
64
50
  loggerService_1.loggerService.info(`handleRemoteItemsFeedParsing: ${piFeedData.url} ${piFeedData.id}`);
65
51
  queueMessages.push({
66
52
  url: piFeedData.url,
@@ -83,10 +69,10 @@ const handleAllRemoteItemsFeedParsing = (channel, params) => __awaiter(void 0, v
83
69
  const latestChannel = yield channelService.get(channel.id);
84
70
  const results = [];
85
71
  const podrollResults = yield handleRemoteItemsPodrollParsing(latestChannel, params);
86
- // const publisherResults = await handleRemoteItemsPublisherParsing(latestChannel, params);
87
- // const channelResults = await handleRemoteItemsChannelParsing(latestChannel, params);
88
- // const timeSplitResults = await handleRemoteItemsItemValueTimeSplitParsing(latestChannel, params);
89
- results.push(...podrollResults);
72
+ const publisherResults = yield handleRemoteItemsPublisherParsing(latestChannel, params);
73
+ const channelResults = yield handleRemoteItemsChannelParsing(latestChannel, params);
74
+ const timeSplitResults = yield handleRemoteItemsItemValueTimeSplitParsing(latestChannel, params);
75
+ results.push(...podrollResults, ...publisherResults, ...channelResults, ...timeSplitResults);
90
76
  return results;
91
77
  });
92
78
  exports.handleAllRemoteItemsFeedParsing = handleAllRemoteItemsFeedParsing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-parser",
3
- "version": "5.1.12",
3
+ "version": "5.1.13-alpha.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,9 +17,9 @@
17
17
  "license": "AGPLv3",
18
18
  "dependencies": {
19
19
  "module-alias": "^2.2.3",
20
- "podverse-external-services": "^5.1.12",
21
- "podverse-helpers": "^5.1.12",
22
- "podverse-orm": "^5.1.12",
20
+ "podverse-external-services": "^5.1.13-alpha.3",
21
+ "podverse-helpers": "^5.1.13-alpha.1",
22
+ "podverse-orm": "^5.1.13-alpha.2",
23
23
  "podverse-partytime": "^5.0.0"
24
24
  },
25
25
  "devDependencies": {