Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 348178 Details for
Bug 467110
net-misc/mediatomb-0.12.1-r5 fails to retrieve YouTube videos
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to enable youtube support in mediatomb using youtube-dl
mediatomb-youtube_a.patch (text/plain), 2.55 KB, created by
Bas Nedermeijer
on 2013-05-13 16:52:48 UTC
(
hide
)
Description:
Patch to enable youtube support in mediatomb using youtube-dl
Filename:
MIME Type:
Creator:
Bas Nedermeijer
Created:
2013-05-13 16:52:48 UTC
Size:
2.55 KB
patch
obsolete
>--- /home/henkie/mediatomb/mediatomb-0.12.1/src/youtube_video_url.cc 2010-04-03 22:23:31.000000000 +0200 >+++ youtube_video_url.cc 2013-05-13 18:49:48.332455878 +0200 >@@ -117,7 +117,75 @@ > > watch = _(YOUTUBE_URL_WATCH) + video_id; > >- Ref<URL> url(new URL(YOUTUBE_PAGESIZE)); >+ /* >+ * NOTE ON PATCH: >+ * >+ * The original code does not seem to work anymore. >+ * >+ * I have commented-out all the original code, and instead >+ * replaced it with a call/exec to youtube-dl (this is a separate/stand-alone python script). >+ * >+ * Available at http://rg3.github.io/youtube-dl/ >+ * >+ * >+ * The current code works on a/my samsung TV. I have not tested it further on other devices. >+ * (I needed a quick fix, because I wanted to watch some video's. :) ) >+ * >+ * I thought I would share the results. >+ * >+ * Suggestions / feedback -> bas-patch@tcfaa.nl >+ * >+ * Regards, Bas Nedermeijer >+ */ >+ >+ int pipefd[2]; >+ pipe(pipefd); >+ >+ if (fork() == 0) >+ { >+ // close reading end in the child >+ close(pipefd[0]); >+ >+ // send stdout to the pipe >+ dup2(pipefd[1], 1); >+ // send stderr to the pipe >+ dup2(pipefd[1], 2); >+ >+ // this descriptor is no longer needed >+ close(pipefd[1]); >+ >+ // This code assumes youtube-dl is available for usage. >+ execl("/usr/bin/youtube-dl", "/usr/bin/youtube-dl","-g",watch.c_str(),NULL); >+ } >+ else >+ { >+ // parent >+ // >+ char buffery[8192]; >+ memset(&buffery[0], 0, sizeof(buffery)); >+ >+ close(pipefd[1]); // close the write end of the pipe in the parent >+ >+ // Hopefully the read is never called twice, otherwise the buffer will become corrupt. >+ while (read(pipefd[0], buffery, sizeof(buffery)) != 0) >+ { >+ } >+ >+ log_debug("------> GOT BUFFER %s\n", buffery); >+ String result = _(buffery); >+ >+ result = trim_string(result); >+ >+ log_debug("------> GOT BUFFER (after trimming) %s\n", result.c_str()); >+ >+ return result; >+ } >+ >+ >+ >+#if 0 >+ >+Ref<URL> url(new URL(YOUTUBE_PAGESIZE)); > > Ref<StringBuffer> buffer = url->download(watch, &retcode, curl_handle, > false, verbose, true); >@@ -164,6 +232,7 @@ > params = _(YOUTUBE_URL_GET) + YOUTUBE_URL_PARAM_VIDEO_ID + '=' + > video_id + '&' + YOUTUBE_URL_PARAM_T + '=' + params; > >+ > if (mp4) > { > String format = _("&fmt=18"); >@@ -200,6 +269,7 @@ > } > > throw _Exception(_("Could not retrieve YouTube video URL")); >+ #endif > } > > #endif//YOUTUBE
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 467110
:
346508
| 348178