Giter Site home page Giter Site logo

Comments (5)

mercuree avatar mercuree commented on August 27, 2024

Can you provide html you are working with?

from html-telegraph-poster.

JohnPlayerSpecial avatar JohnPlayerSpecial commented on August 27, 2024

It is a bigger project, in which I'm parsing a Blog post, and it happened to contain a YT video.

from html_telegraph_poster import upload_to_telegraph
url2send = upload_to_telegraph(title=title, author='me', text=text)["url"]

variable text contains all the html (which I am modifying in order to be able to be able to upload to telegraph and to trim garbage :) )

I get a telegraph page with all images/text, but without video.
Hence I tried to hardcoding variable text just before the line

url2send = upload_to_telegraph(title=title, author='me', text=text)["url"]

like this

text = "<video><source src="VIDEOURL"></video>"
url2send = upload_to_telegraph(title=title, author='me', text=text)["url"]

or

text = "<embed src="VIDEOURL">"
url2send = upload_to_telegraph(title=title, author='me', text=text)["url"]

but I can't

Thanks in advance

from html-telegraph-poster.

mercuree avatar mercuree commented on August 27, 2024
  1. telegra.ph only supports youtube and vimeo iframe tags, so your html should contain for example:
<iframe width="560" height="315" src="https://www.youtube.com/embed/EOQj_Ql4WSY" frameborder="0" allowfullscreen></iframe>

This is what youtube offers for embedding
2. video tag is supported for gifs without the sound.
3. embed tag is unsupported.
4. You can read tests for iframe here https://github.com/mercuree/html-telegraph-poster/blob/master/tests/htp_test.py#L280

from html-telegraph-poster.

JohnPlayerSpecial avatar JohnPlayerSpecial commented on August 27, 2024

Thanks for the kind response, you're been awesome.
Just Successfully embedded the YT video as you said.
In this blog post there is also a facebook iframe video, but as you said I have no hope...
Thanks again

from html-telegraph-poster.

mercuree avatar mercuree commented on August 27, 2024

Instant view supports facebook videos
https://instantview.telegram.org/docs#embedded-elements
but you have to write instant view template

from html-telegraph-poster.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.