podverse-parser 5.1.12-alpha.1 → 5.1.12
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":"parser.d.ts","sourceRoot":"","sources":["../../../src/lib/rss/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,
|
|
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"}
|
package/dist/lib/rss/parser.js
CHANGED
|
@@ -42,20 +42,6 @@ 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
|
-
}
|
|
59
45
|
const parseRSSFeedAndSaveToDatabase = (url, podcast_index_id, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
46
|
const { onDemandParserEvent } = options;
|
|
61
47
|
const onDemandParserEventService = new podverse_orm_1.OnDemandParserEventService();
|
|
@@ -86,7 +72,6 @@ const parseRSSFeedAndSaveToDatabase = (url, podcast_index_id, options) => __awai
|
|
|
86
72
|
if (!url || !podcast_index_id) {
|
|
87
73
|
throw new Error(`parseRSSFeedAndSaveToDatabase: url or podcast_index_id is missing for ${url} ${podcast_index_id}`);
|
|
88
74
|
}
|
|
89
|
-
yield handleRateLimitRequestDelay(url);
|
|
90
75
|
loggerService_1.loggerService.info(`parseRSSFeedAndSaveToDatabase url: ${url} podcast_index_id: ${podcast_index_id}`);
|
|
91
76
|
feed = yield (0, feed_1.handleGetRSSFeed)(url, podcast_index_id);
|
|
92
77
|
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;
|
|
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"}
|
|
@@ -14,6 +14,19 @@ 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
|
+
}
|
|
17
30
|
const handleRemoteItemsFeedParsing = (feedGuidsToParse, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
31
|
var _a, _b;
|
|
19
32
|
const { accountId, remoteParentPodcastIndexId } = params;
|
|
@@ -47,6 +60,7 @@ const handleRemoteItemsFeedParsing = (feedGuidsToParse, params) => __awaiter(voi
|
|
|
47
60
|
podcast_index_id: piFeedData.id
|
|
48
61
|
});
|
|
49
62
|
if (!feed) {
|
|
63
|
+
yield handleRequestDelay(piFeedData.url);
|
|
50
64
|
loggerService_1.loggerService.info(`handleRemoteItemsFeedParsing: ${piFeedData.url} ${piFeedData.id}`);
|
|
51
65
|
queueMessages.push({
|
|
52
66
|
url: piFeedData.url,
|
|
@@ -69,10 +83,10 @@ const handleAllRemoteItemsFeedParsing = (channel, params) => __awaiter(void 0, v
|
|
|
69
83
|
const latestChannel = yield channelService.get(channel.id);
|
|
70
84
|
const results = [];
|
|
71
85
|
const podrollResults = yield handleRemoteItemsPodrollParsing(latestChannel, params);
|
|
72
|
-
const publisherResults =
|
|
73
|
-
const channelResults =
|
|
74
|
-
const timeSplitResults =
|
|
75
|
-
results.push(...podrollResults
|
|
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);
|
|
76
90
|
return results;
|
|
77
91
|
});
|
|
78
92
|
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.12",
|
|
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.12",
|
|
21
|
+
"podverse-helpers": "^5.1.12",
|
|
22
|
+
"podverse-orm": "^5.1.12",
|
|
23
23
|
"podverse-partytime": "^5.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|