diff --git a/ui/components/EmbedPlayer.vue b/ui/components/EmbedPlayer.vue
new file mode 100644
index 00000000..0b692a4e
--- /dev/null
+++ b/ui/components/EmbedPlayer.vue
@@ -0,0 +1,30 @@
+
+
+
Not downloaded yet.
+
+
+
+
+
+
+
diff --git a/ui/components/History.vue b/ui/components/History.vue
index 44be0a0f..131cd808 100644
--- a/ui/components/History.vue
+++ b/ui/components/History.vue
@@ -103,6 +103,12 @@
v-if="item.extras?.thumbnail" />
+
+
+
pImg(e)" :src="'/api/thumbnail?url=' + encodePath(item.extras.thumbnail)"
+ v-if="item.extras?.thumbnail" />
+
+
pImg(e)" v-if="item.extras?.thumbnail"
:src="'/api/thumbnail?url=' + encodePath(item.extras.thumbnail)" />
@@ -243,6 +249,14 @@
+
+
@@ -251,6 +265,7 @@ import moment from 'moment'
import { useStorage } from '@vueuse/core'
import { makeDownload, formatBytes, ucFirst } from '~/utils/index'
import toast from '~/plugins/toast'
+import { isEmbedable, getEmbedable } from '~/utils/embedable'
const emitter = defineEmits(['getInfo'])
const config = useConfigStore()
@@ -263,6 +278,7 @@ const showCompleted = useStorage('showCompleted', true)
const hideThumbnail = useStorage('hideThumbnailHistory', false)
const direction = useStorage('sortCompleted', 'desc')
+const embed_url = ref('')
const video_item = ref(null)
const playVideo = item => video_item.value = item
diff --git a/ui/components/Queue.vue b/ui/components/Queue.vue
index 4ae417e8..8277e38f 100644
--- a/ui/components/Queue.vue
+++ b/ui/components/Queue.vue
@@ -52,11 +52,18 @@
@@ -133,6 +140,14 @@
+
+
@@ -140,6 +155,7 @@
import moment from 'moment'
import { useStorage } from '@vueuse/core'
import { ucFirst } from '~/utils/index'
+import { isEmbedable, getEmbedable } from '~/utils/embedable'
const emitter = defineEmits(['getInfo'])
const config = useConfigStore();
@@ -150,6 +166,7 @@ const selectedElms = ref([]);
const masterSelectAll = ref(false);
const showQueue = useStorage('showQueue', true)
const hideThumbnail = useStorage('hideThumbnailQueue', false)
+const embed_url = ref('')
watch(masterSelectAll, (value) => {
for (const key in stateStore.queue) {
diff --git a/ui/utils/embedable.js b/ui/utils/embedable.js
new file mode 100644
index 00000000..be78437c
--- /dev/null
+++ b/ui/utils/embedable.js
@@ -0,0 +1,69 @@
+const sources = [
+ {
+ name: 'youtube',
+ url: 'https://www.youtube-nocookie.com/embed/',
+ regex: /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,
+ },
+ {
+ name: "instagram",
+ url: "https://www.instagram.com/p/",
+ regex: /https?:\/\/(?:www\.)?instagram\.com\/p\/([^/?#&]+)/,
+ },
+ {
+ name: "twitter",
+ url: "https://twitter.com/i/status/",
+ regex: /https?:\/\/(?:www\.)?twitter\.com\/i\/status\/([^/?#&]+)/,
+ },
+ {
+ name: "facebook",
+ url: "https://www.facebook.com/plugins/post.php?href=",
+ regex: /https?:\/\/(?:www\.)?facebook\.com\/(?:[^/?#&]+)\/posts\/([^/?#&]+)/,
+ },
+ {
+ name: "tiktok",
+ url: "https://www.tiktok.com/embed/",
+ regex: /https?:\/\/(?:www\.)?tiktok\.com\/(?:[^/?#&]+)\/video\/([^/?#&]+)/,
+ },
+ {
+ name: "vimeo",
+ url: "https://player.vimeo.com/video/",
+ regex: /https?:\/\/(?:www\.)?vimeo\.com\/(?:[^/?#&]+)\/([^/?#&]+)/,
+ },
+ {
+ name: "soundcloud",
+ url: "https://w.soundcloud.com/player/?url=",
+ regex: /https?:\/\/(?:www\.)?soundcloud\.com\/(?:[^/?#&]+)\/([^/?#&]+)/,
+ },
+ {
+ name: "spotify",
+ url: "https://open.spotify.com/embed/",
+ regex: /https?:\/\/(?:open\.)?spotify\.com\/(?:[^/?#&]+)\/([^/?#&]+)/,
+ },
+ {
+ name: "twitch",
+ url: "https://player.twitch.tv/?channel=",
+ regex: /https?:\/\/(?:www\.)?twitch\.tv\/(?:[^/?#&]+)\/([^/?#&]+)/,
+ },
+ {
+ name: "mixcloud",
+ url: "https://www.mixcloud.com/widget/iframe/",
+ regex: /https?:\/\/(?:www\.)?mixcloud\.com\/(?:[^/?#&]+)\/([^/?#&]+)/,
+ },
+ {
+ name: "dailymotion",
+ url: "https://www.dailymotion.com/embed/video/",
+ regex: /https?:\/\/(?:www\.)?dailymotion\.com\/(?:[^/?#&]+)\/video\/([^/?#&]+)/,
+ },
+]
+
+const isEmbedable = url => {
+ return sources.some(source => source.regex.test(url));
+}
+
+const getEmbedable = url => {
+ const source = sources.find(source => source.regex.test(url));
+ const id = source.regex.exec(url)[1];
+ return source.url + id;
+}
+
+export { isEmbedable, getEmbedable };