I'm trying to embed an mp4 video from an external website onto a wall post using the API. The result should look the same as when a user uploads a video: there is a thumbnail from the video displayed, and clicking on it plays the video inline.
From the documentation, I expected this to work:
$ curl -k -F 'access_token=BAAC8...' \
-F 'message=A test' \
-F 'source=<full url of mp4>' \
https://graph.facebook.com/me/feed
but the source argument just results in the domain name from the URL being displayed, and it's not even a link.
I tried using link= instead of source=. At least it results in a clickable link, but the content is the URL, and clicking on it displays the video in a new page.
I also tried posting to https://graph.facebook.com/me/links, but the result was the same as using links= and /me/feed.
I've found similar questions where the answers suggest it's possible with youtube videos and/or swf files, but they seem to be doing exactly what I've already tried.
Is this possible, and if so, how?
Related
I like to write an api that accept from the user a video via a post command. Any body can let me know how can I use Flask-Uploads for extensions mp4 or other video extensions?
The version of Flask-Uploaded on PyPi is broken since February 2020.
You can use the drop in replacement: https://pypi.org/project/Flask-Reuploaded/
When you want a file extension, which is not contained in a pre-defined set, you just can create your own one.
e.g.
VIDEOS = tuple("mp4 mov")
and then configure Flask-Reuploaded as described in the documentation, i.e
videos = UploadSet('videos', VIDEOS)
If you do not want to use Flask-Reuploaded, there is a very good blog post by Miguel Grinberg explaining all the details - without using an upload extension:
https://blog.miguelgrinberg.com/post/handling-file-uploads-with-flask
I'm trying to make a video cross-browser. I have encoded the video with the required codecs etc. When run through the Django server, both Chrome and Firefox show their respective video (Chrome displays the .mp4, and Firefox the .ogv). However Safari can not display the video. I know it is not an encoding problem because when I just open the raw html file and manually move the same video to the right directory, the video loads up just fine. And it's not a referencing error because the mp4 file is being played just fine in Chrome when running the Django development server.
I'm not sure what code I could give, because no errors are being thrown, even in the terminal the request for the video is a green HTTP 200, it just doesn't display. Are there any known errors with deploying videos from django?
I tried hardcoding urls, putting the video in static rather than media, but nothing works.
Versions: Latest of everything.
Edit: I have quicktime installed, which seems to be a the cause of this problem too.
If I right click on the empty video pane and click download video, it downloads the playable mp4 video.
If I copy the video path from the safari video and paste in chrome, the mp4 video plays fine in chrome. And still plays fine in Safari when the raw html is linked to the video.
I am adding the videos into my django uploaded media file through admin, could this be why? (Not sure why it would be given it's just Safari that's not working)
After playing around for a bit I got this error:
OSError: [Errno 41] Protocol wrong type for socket
[27/Mar/2016 05:04:01] "GET /media/media/uploads/SampleVideo25.mp4 HTTP/1.1" 500 59
Another edit:
After seeing many people say that it is just the django development server I deployed my site to Heroku. The same thing occurs. It works in Chrome and Firefox but not in Safari, and when checking the logs it just says it retrieved the video with a Http 200 status.
The only other option I could try is serving the videos through AWS3
This is a common issue for the development server. There are quite a few issues on Django project regarding this one, but I think the following describes the best why it is not addressed:
if we are adding runserver support for something that's not even supported by what I think is a fairly common web server, that seems like it will only encourage more people to use runserver in production.
Relevant issue #22479 but as mentioned above you can find many similar issues that are or could be related to your problem.
You can try to serve video from an outside url during your development, this should be a workaround. At least this is what I have done in the past.
For whatever reason, the video shows just fine when called from the AWS3.
I am using this to share a content to facebook:
curl -X POST \
-F "id=http://www.vtrack.cl/" \
-F "scrape=true" \
-F "picture=http://www.vtrack.cl/pub/media/social/gps303g_fb.png" \
"https://graph.facebook.com"
I need to customize which image is shown in the sharing dialog, but it did not work. Can you help me?
You don´t have ANY OG tags on your website. With the scrape=true parameter, you can refresh the OG tags, but i am pretty sure you can´t just set any image. You need to add that image URL as og:image tag.
I am not sure if this is even documented correctly - it should work to refresh the tags though, i am doing the same with JavaScript. There´s definitely no picture parameter though, although i don´t even find the "scrape" parameter and that one definitely works: https://developers.facebook.com/docs/graph-api/reference/v2.5/url
I am looking to export an entire sitecore page. Ideally, upon exporting the links would move from relative to absolutely, but that's not necessary. I want to download the html, css, images, everything from one of my pages. Any help would be greatly appreciated.
Assuming that you want to download one page only, you should be able to just use Save option in your browser. Most of the modern browsers supports all of your requirements. Sitecore web page is like any other html page.
If you want to download the whole site, you can try to use http://www.httrack.com/, wget or Firefox plugin as described here.
If none of those are enough, try to search for save entire site with images and css in your favourite search engine - there are plenty of other possibilites.
If I only have to locally save a page hosted in our Sitecore (really doesn't matter what's hosting it) I use wget.
This seems to work quite well:
wget.exe -E -H -k -K -p --no-check-certificate <your url>
You can change the parameters to recursively spider the whole site, if you do so make sure to check with your security department to not set of any alarms.
I need to take image frames from a webcam server using selenium python module.
The frames webcam is show on the selenium browser ( using http:// .....html webpage) .
The source code of the page show me it's done using some java script.
I try to use:
capture_network_traffic() and captureNetworkTraffic
Not working , also I don't think is a good way to do that.
Also I don't want to use capture_screenshot functions , this take all canvas of the browser.
Any idea ?
Thank you. Regards.
First, what you'll need to do is navigate to the webpage with Selenium.
Then, analyse the web page source HTML which the Javascript will have rendered by you navigating to the page, to get the image URL. You can do this with Selenium or with an HTML parser.
Then you can easily download the image using wget or some other URL grabber.
You might not even need Selenium to accomplish this if when you get the page, the image is already there. If that is the case you can just use the URL grabber to get the page directly.
Let me know if you want more details or if you have any questions.