mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-13 08:57:04 +02:00
.devcontainer
.github
.vscode
build
client
images
server
controllers
finders
libs
managers
models
objects
providers
routers
scanner
utils
generators
migrations
parsers
parseFullName.js
parseNameString.js
parseOPML.js
parseOpfMetadata.js
parseOverdriveMediaMarkers.js
queries
areEquivalent.js
constants.js
downloadWorker.js
ffmpegHelpers.js
fileUtils.js
globals.js
htmlEntities.js
htmlSanitizer.js
index.js
libraryHelpers.js
notifications.js
podcastUtils.js
probeWorker.js
prober.js
scandir.js
toneHelpers.js
toneProber.js
zipHelpers.js
Auth.js
Database.js
Logger.js
Server.js
SocketAuthority.js
Watcher.js
.dockerignore
.gitattributes
.gitignore
Dockerfile
LICENSE
docker-compose.yml
docker-template.xml
index.js
package-lock.json
package.json
prod.js
readme.md
24 lines
633 B
JavaScript
24 lines
633 B
JavaScript
const h = require('htmlparser2')
|
|
const Logger = require('../../Logger')
|
|
|
|
function parse(opmlText) {
|
|
var feeds = []
|
|
var parser = new h.Parser({
|
|
onopentag: (name, attribs) => {
|
|
if (name === "outline" && attribs.type === 'rss') {
|
|
if (!attribs.xmlurl) {
|
|
Logger.error('[parseOPML] Invalid opml outline tag has no xmlurl attribute')
|
|
} else {
|
|
feeds.push({
|
|
title: attribs.title || 'No Title',
|
|
text: attribs.text || '',
|
|
feedUrl: attribs.xmlurl
|
|
})
|
|
}
|
|
}
|
|
}
|
|
})
|
|
parser.write(opmlText)
|
|
return feeds
|
|
}
|
|
module.exports.parse = parse |