Coder Social home page Coder Social logo

Comments (3)

dstillman avatar dstillman commented on May 20, 2024

The YouTube translator uses scraping for some fields because of this:

translators/YouTube.js

Lines 101 to 103 in 7837c42

/* YouTube won't update the meta tags for the user,
* if they open e.g. a suggested video in the same tab.
* Thus we scrape them from screen instead.

But when run from translation-server we only have the JSON-LD. So maybe we need to check whether the page is actually built and fall back to JSON-LD for all fields if not.

from translators.

geofferb avatar geofferb commented on May 20, 2024

@dstillman Upon further testing, I've found that the translation-server can only get the useless BreadcrumbList JSON-LD and not the VideoObject one the translator uses. However, it seems to get <meta> tags fine; could those be used as a fallback?

Also, is there a way to see the HTML retrieved by translation-server? It would make debugging this much easier.

from translators.

dstillman avatar dstillman commented on May 20, 2024

Probably, but we would have to make sure it was only using the meta tags for over-the-wire saves and never using them for Connector-based saves, due to the problem explained in the comment. So we'd have to make sure we were detecting that properly.

Also, is there a way to see the HTML retrieved by translation-server?

Yes, you can add Zotero.debug(doc.documentElement.innerHTML) or similar. (But it's likely just the same as you'd get with curl.)

from translators.

Related Issues (20)

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.