Adapt main.ts to use PeerTubeRequester.prototype.uploadFromUrl
This commit is contained in:
parent
51126e7f0f
commit
b2b04df23b
|
@ -54,7 +54,7 @@ async function register({
|
||||||
await addListeners(settings["ytb-urls"]);
|
await addListeners(settings["ytb-urls"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
myManager.on("newEntries", (entries: any) => {
|
myManager.on("newEntries", async (entries: any) => {
|
||||||
const datas = listenersDataBinding.get(entries.addressListener);
|
const datas = listenersDataBinding.get(entries.addressListener);
|
||||||
if (!datas) return;
|
if (!datas) return;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ async function register({
|
||||||
JSON.stringify(entries)
|
JSON.stringify(entries)
|
||||||
);
|
);
|
||||||
for (const item of entries.items)
|
for (const item of entries.items)
|
||||||
peertube.apiRequest({
|
await peertube.uploadFromUrl({
|
||||||
channelId: datas.channelId,
|
channelId: datas.channelId,
|
||||||
targetUrl: item.link,
|
targetUrl: item.link,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user