Commit graph

443 commits

Author SHA1 Message Date
Thomas Zarebczan
56ce70cef5
Revert "Undo the hardcoded ad div id (#1719)" (#1722)
This reverts commit 5888b6b7d8.
2022-06-21 06:12:47 -04:00
infinite-persistence
5888b6b7d8
Undo the hardcoded ad div id (#1719)
I previously hardcoded both IDs since the script was not looking the right one at one point, but I guess that was unnecessary.

I don't think it causes any problems, because I'm still just loading 1 script (no double video, just 2 divs for them to choose).

Note that we are still using the `filepage` script since the `homepage` one is not working.
2022-06-21 05:51:07 -04:00
Rave | 図書館猫
d40260374d
Inject close button into footer banner ad (#1710)
* Make shouldLoadSticky dynamic again

* Adjust of statement

* Update statement again...

* Adjust selector. Again.
2022-06-17 12:07:08 -04:00
infinite-persistence
91e83760d4 Enable Sticky on the homepage
This excludes mobile and other scenarios handled by the `should*` variables.
2022-06-15 07:34:36 -04:00
infinite-persistence
e70ed61d4e OBR-hack: move AdsSticky up to make it load first
We are asking Outbrain to make it order-agnostic, but for now, we need to load the Sticky script first before the Banner script.

This is ugly code because the requirement is not obvious unless we put a bunch of comments, but I don't want to pollute `app/view.jsx`. Hopefully they can address this and we can revert in the coming days.
2022-06-15 07:34:36 -04:00
infinite-persistence
6c6aa7a117 AdsBanner: singleton script
Makes it play nice with AdsSticky, both of which uses the same `window.OBR` object.
2022-06-15 07:34:36 -04:00
infinite-persistence
b9af50dede
GoogleVideo: generate instead of fetch the content url (#1691)
Seeing performance issues.
2022-06-15 06:54:53 -04:00
Rave | 図書館猫
d5b7f25191
Add cookie spaceman to gdpr banner (#1651)
* Add cookie spaceman to gdpr banner

* Add spaceman graphic to static

* Add graphic to STATIC_ASSET_PATHS

* Add cookie spaceman to gdpr banner

* Add spaceman graphic to static

* Add graphic to STATIC_ASSET_PATHS

* Hide spaceman on mobile

* Adjust gdpr container for medium screens
2022-06-13 15:29:13 +02:00
infinite-persistence
60f48b1a3b
Fix invalid claims ending up with status 500 (#1678)
## Issue
Due the `parseUri` not being used in a try-catch block, the thrown error surfaces all the way up and the 500 catch-all status was used.

The search console was been complaining about this for a while now. I've always thought "what's the problem here, you entered the wrong claim format", but now I realized it's about the error code.

## Change
`try-catch` the call as normal for that function, and return 404. We will still relay the error message it was.
2022-06-13 08:55:45 -04:00
infinite-persistence
075b8bcf62
Handle invalid /$/download and /$/stream with a 404 (#1676)
## Issue
- When `/$/download/:claimname/:claimId` is invalid, it results in a bad redirect loop that keeps requesting the same thing. Eventually it stops, though.
- When `/$/stream/:claimname/:claimId` is invalid, it results in a 302 page that simply says `Redirecting to .`, and is increasing in count in the search console.

## Fix
Return a 404 not found for these.
2022-06-13 08:35:24 -04:00
Thomas Zarebczan
968db6652a
Fix crash on direct load (anonymous only?) 2022-06-10 13:12:57 -04:00
infinite-persistence
2a83c7d8ec
GoogleVideo: fix contentUrl and add more metadata (#1659)
* GoogleVideo: add more metadata

* GoogleVideo: fix `contentUrl`

`contentUrl` needs to be the url of the video file itself, not the page or some redirect.  Copied the way the url is generated in the RSS code.
2022-06-10 07:22:09 -04:00
infinite-persistence
70695dfd3f
Move Google Video code into another file
html.js is getting messy, and we'll be adding more Google Video stuff
2022-06-09 14:09:52 +08:00
infinite-persistence
baf1058510
Homepage API: add ?format=roku support (#1655)
Formatting changes for Roku to parse the data properly.
`https://github.com/OdyseeTeam/odysee-homepages/issues/1570`
2022-06-09 00:53:58 -04:00
infinite-persistence
e5bea1d0c4
Switch to file-page ad until Adnim fixes the script
Also placed both tag ids in case one breaks again.
2022-06-09 10:07:36 +08:00
Rave | 図書館猫
8a16ca03be
Adnim patch (#1647)
* Fix adnim ads

* Adjust ad container width

* Change widget on mobile

* Fix 3 column grid

* Ad ad banner top bar

* Ad ad banner bottom bar on mobile

* Ad ad banner bottom bar radius on mobile

* Adjust ad banners on mobile

* Make some mobile adjustments

* Remove dbeug box

* Combine ad classes
2022-06-07 15:16:26 -04:00
dependabot[bot]
9dc03d816a Bump protobufjs from 6.11.2 to 6.11.3 in /web
Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 6.11.2 to 6.11.3.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/v6.11.3/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/v6.11.2...v6.11.3)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-03 01:57:01 -04:00
Thomas Zarebczan
37d9db9cf2 not sure why this has to be the same
otherwise it just shows the premium driver...tried a few things, and it seemed to work fine like this. Maybe due to some cleanup/styles, etc
2022-06-02 13:02:38 -04:00
Thomas Zarebczan
328c8938c6 Use separate ad for file pages 2022-06-02 13:02:38 -04:00
infinite-persistence
70ddd08df6 Show Sticky in Content and Channel Page for incognito
https://odysee-workspace.slack.com/archives/C02G20Z2AEL/p1654171314724029?thread_ts=1654089384.715699&cid=C02G20Z2AEL

Content: not showing ads for signed-in users because it interferes with commenting.

Channel: same behavior as Categories (i.e. show is not Premium+).
2022-06-02 10:49:42 -04:00
infinite-persistence
331ae641d0
No sticky in mobile, and only show in Category.
## Code changes
- Switch from blacklist to whitelist.
2022-06-01 21:58:29 +08:00
infinite-persistence
d5910c8172
Fix sticky not reliably opening when navigated into page
## Issue
Stickly loads fine when Category Page is opened directly (F5, open), but doesn't load if F5 was at Homepage and then navigated into Category Page.

## Root
There is a bug where AdsSticky cannot be loaded on a page where AdsBanner exists. As long as AdsSticky is loaded in a page without AdsBanner, they both can still be visible together later, says from navigating around.

## Temp fix
Adding inAllowedPath to the logic is a band-aid that relies on AdsBanner only being used in Homepage for now, which we currently happen to not place AdsSticky.
2022-06-01 12:48:14 +08:00
infinite-persistence
0bcea943d5 Re-implement/enable sticky ad
## Ticket
1583: "add incontent ads to category/channel pages (break up every X claims?), or add back bottom ad in those areas."

## Behavioral changes
- Hide when in homepage (as currently we have ads between categories).
- Fix the light theme (it was transparent).

## Code changes
- While an Effect is the 'right' choice given that there is no jsx to mount, the need to prop-drill from the parent was getting a bit annoying, so converted to a Component instead.
- Remove the delay for Core Vitals avoidance for now -- seems to make the sticky less likely to serve an ad.
- Now that the membership state is correctly populated for incognito (see 9d830615), there is no more need to check for `isAuthenticated`.
2022-05-31 10:34:38 -04:00
infinite-persistence
deb95cd443
Fix stale-closure in ad-detection code
Using that global variable was a bad idea. Stick to redux as the source of truth.

The flag is not listed for rehydration, so it will always start off as `undefined`, which is what we need anyways.

`undefined` indicates we haven't tested for ad-blockers, so we'll run the fetch and update the store with a true|false value.
2022-05-30 19:03:20 +08:00
infinite-persistence
003992e5c6
Add new list of ad configs
Still remain using the 5-tile banner-ad, though. There are theme and other issues with the rest.
2022-05-27 20:49:57 +08:00
infinite-persistence
c66f597f09
Fix accumulation of ad <style> tags 2022-05-27 20:48:54 +08:00
infinite-persistence
3557e72419
Remount banner on theme-change as their ad can't change theme on the fly.
It would be nice if the individual components can handle the remounting of the ad-script, but there is currently a need to synchronize the cleanup of the `window.OBR` object.

The quickest solution for now is to add a key at the parent side to synchronize the mount-unmounting. Not ideal -- revisit later.
2022-05-27 20:48:53 +08:00
infinite-persistence
551c13251a
Update AR_6 to AR_18
- This increases the amount of ads, filling up the entire width. No more need to restrict with `max-width` ourself.

- Changed the ad-driver to top-right since the "Powered by Outbrain" text is now locked in bottom-right. Also made the container having a minimum height, as the method to "display the driver after ads are loaded" is not future proof -- it depends on the IDs being used by the ad. Reserving some space seems to be easiest, and it also reduces shifts as well.
2022-05-27 20:48:53 +08:00
infinite-persistence
327a574982
Create banner ads and add to homepage
## Behavior in homepage
- Mobile: show after every other category
- Desktop: show after first category, then every 2 categories.

## Known issue:
- "FYP" is not part of the categories array at the moment, so it does mess up the behavior.

## Notes
I think this is also called "in-content" by adnim (not 100% sure of the terminology).
2022-05-27 20:48:51 +08:00
infinite-persistence
b1dbac8f9b
Factor out ad-blocker detection into useShouldShowAds
... for it to be re-used on other ad components.
2022-05-27 20:48:51 +08:00
infinite-persistence
6576e8317e
Replace Vidcrunch with Adnimation 2022-05-27 20:48:50 +08:00
infinite-persistence
b8cf1a6c4c RSS: parallel-fetch the stream urls
## Issue
Users are seeing timeout with the RSS calls.
But oddly, odysee.com is significantly slower than the dev instances.
2022-05-27 08:38:18 -04:00
infinite-persistence
a73694deb4 Fix localStorage crash
## Ticket
1572
Always check for availability before use.

## Changes
- Consolidated the keys into one place for easier tracking.
  - It'll also be easier to code using constant autocomplete.
- Cleaned up the wrapper to be as close as the original.
- Updated existing code to use the wrapper (even if they already handled the availability) to encourage future code to just use the wrapper.
2022-05-26 08:27:35 -04:00
infinite-persistence
7d1992d541
Handle CUSTOM_HOMEPAGE=false
This one's been broken for a while, but should only affect `yarn dev-server` and those who does not have access to the homepages.
2022-05-23 15:40:41 +08:00
infinite-persistence
ceca6e3b84
Handle missing announcement file in dev-server 2022-05-23 15:30:40 +08:00
infinite-persistence
178b0d751d
astronaut_n_friends.png: fix src and caching
1. Hardcoding breaks any image changes done on dev instances or locally.
2. The relative path is bad, and there are few more instances of it. But continue as is for now, will file a ticket to fix this.
3. Fix caching.
2022-05-20 19:04:35 +08:00
Thomas Zarebczan
38d3fa1186
Oops 2022-05-19 18:13:19 -04:00
Thomas Zarebczan
07b9b2feed
Fix rss URLs for mp4s 2022-05-19 17:54:53 -04:00
infinite-persistence
245eb39892
Add 'announcement' to v2 homepage api
This requires an accompanying commit in the homepages repo (see "Add announcement support").

Using `raw-loader` to import markdown files as a string works for the app-side, but didn't work well in web-side. Falling back to copying the announcement files to `dist` and reading them via `readFileSync`. Don't really like this -- will return with an alternative.
2022-05-20 00:04:05 +08:00
saltrafael
0998e3d48c
Support stream updates via claim_id parameter (#1465)
* Support stream updates via claim_id parameter

* Pass claim_id on v2
2022-05-19 08:13:48 -04:00
Rave | 図書館猫
4c25ae721e
Outside us v2 (#1530)
* Disable ads outside the US (again)
2022-05-19 07:38:27 +02:00
infinite-persistence
f245f09d1c
Revert "Temporarily prevent invalid get calls until we figure it out" (#1529)
This reverts commit f6f15531d4.

The root-cause was known (8dd0982f), and I don't think it worked because:
1. The issue happened at the web side which didn't have logging.
2. The `[object Promise]` came after the `get`, not before.
2022-05-18 20:37:53 -04:00
infinite-persistence
8dd0982f33
Fix bad stream url redirect. (#1524) 2022-05-18 14:32:22 -04:00
infinite-persistence
53079d92b6
Move PremiumPlusTile into Ads (#1522)
* Move `PremiumPlusTile` into `Ads`

This saves the need to repeat the logic everywhere.

* Add option to disable fallback.
2022-05-18 19:52:46 +02:00
Rave | 図書館猫
ffdb5abf63
Tile Grid Revamp (#1502)
* Save

* Save

* Add pulse

* Adjust footer ad

* Adjust tile ad

* Adjust tile ad hover

* Fix premium badge alignment in tile grid

* Adjust livestream icon

* Adjust livestream icon

* Save scheduled livestreasm & tile ad

* Fix scheduled callback

* Fix playlist icon size on file page

* Fix grid distortion in 3 & 4 column layout

* -

* Fix grid on category & channel page

* Fix Premium Plus Grid

* Add custom tile for adblockers

* Reset env

* Remove collapsed tiles

* Remove setLoaded on scheduled livestreams page

* -

* Make isHidden optional

* Remove px

* Review adjustments

* Inject Premium+ ads

* Fix injection

* Fix injection when using the last tile

* Fix injection when using the last tile

* Enable stripe dev

* Create PremiumPlusTile component and add list view design

* Create PremiumPlusTile component and add list view design

* Adjust ads in list view

* Remove setState from render loop

* Clean code

* Fix livestream margin in list view

* Rewrite & tune some logic - Homepage & Channel page

* Clean details...

* Clean details...

* Requested review changes

Signed-off-by: Raphael Wickihalder <raphael.wickihalder@odysee.com>

* Requested review changes

Signed-off-by: Raphael Wickihalder <raphael.wickihalder@odysee.com>
2022-05-18 13:16:35 +02:00
infinite-persistence
f6f15531d4 Temporarily prevent invalid get calls until we figure it out
No analytics for the server side.
2022-05-13 12:08:28 -04:00
infinite-persistence
e0fee8cb25
Fix broken v1 homepage api
Due to 88740082
2022-05-13 20:48:34 +08:00
infinite-persistence
de206162f9
getHtml/routes/rss: fetch streaming_url instead of generating it.
## Issues from the initial attempt
- There are 2 versions of `Lbry` and `buildURI` -- the app and web-server version.  There are subtle differences between them, and for the app case, importing the web-server version results in a query into an invalid URL.
- It changed the function from returning a string to returning a promise.

## Changes
- Since the new function (renamed to `fetchStreamUrl` for clarity) is currently only needed for web-server, I moved it into the `web` folder to avoid misuse in app.
- Await on the promise. Unfortunately, this also means the entire chain of function calls need to be adjusted to be `async`.
2022-05-13 20:23:17 +08:00
infinite-persistence
9f7a163456
Meta: escape chars when generating keywords from tags
A content page contained `"` as a tag, and that caused the meta generator to  produced a malformed page.
2022-05-11 14:56:07 +08:00
infinite-persistence
8874008245 Support homepage-specific memes
1446

- Requires an accompanying commit in `odysee-frontend`.
- The change assumes that the `odysee-frontend` is the only project that uses these files directly, i.e. other clients will use the API instead.
2022-05-10 21:43:14 +08:00