mirror of https://github.com/Chocobozzz/PeerTube
Fix google bot detection
parent
62fcf1fa96
commit
dc151d3f51
|
@ -1,22 +1,22 @@
|
|||
import { Subscription } from 'rxjs'
|
||||
import { catchError, distinctUntilChanged, map, switchMap } from 'rxjs/operators'
|
||||
import { DatePipe, NgClass, NgIf, NgTemplateOutlet } from '@angular/common'
|
||||
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
|
||||
import { ActivatedRoute, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'
|
||||
import { AuthService, MarkdownService, Notifier, RestExtractor, ScreenService, Hotkey, HotkeysService, MetaService } from '@app/core'
|
||||
import { HttpStatusCode, UserRight } from '@peertube/peertube-models'
|
||||
import { ListOverflowComponent, ListOverflowItem } from '../shared/shared-main/misc/list-overflow.component'
|
||||
import { CopyButtonComponent } from '../shared/shared-main/buttons/copy-button.component'
|
||||
import { AccountBlockBadgesComponent } from '../shared/shared-moderation/account-block-badges.component'
|
||||
import { ActorAvatarComponent } from '../shared/shared-actor-image/actor-avatar.component'
|
||||
import { GlobalIconComponent } from '../shared/shared-icons/global-icon.component'
|
||||
import { NgIf, NgTemplateOutlet, NgClass, DatePipe } from '@angular/common'
|
||||
import { AuthService, Hotkey, HotkeysService, MarkdownService, MetaService, RestExtractor, ScreenService } from '@app/core'
|
||||
import { Account } from '@app/shared/shared-main/account/account.model'
|
||||
import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model'
|
||||
import { VideoChannelService } from '@app/shared/shared-main/video-channel/video-channel.service'
|
||||
import { VideoService } from '@app/shared/shared-main/video/video.service'
|
||||
import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model'
|
||||
import { Account } from '@app/shared/shared-main/account/account.model'
|
||||
import { BlocklistService } from '@app/shared/shared-moderation/blocklist.service'
|
||||
import { SupportModalComponent } from '@app/shared/shared-support-modal/support-modal.component'
|
||||
import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription/subscribe-button.component'
|
||||
import { HttpStatusCode, UserRight } from '@peertube/peertube-models'
|
||||
import { Subscription } from 'rxjs'
|
||||
import { catchError, distinctUntilChanged, map, switchMap } from 'rxjs/operators'
|
||||
import { ActorAvatarComponent } from '../shared/shared-actor-image/actor-avatar.component'
|
||||
import { GlobalIconComponent } from '../shared/shared-icons/global-icon.component'
|
||||
import { CopyButtonComponent } from '../shared/shared-main/buttons/copy-button.component'
|
||||
import { ListOverflowComponent, ListOverflowItem } from '../shared/shared-main/misc/list-overflow.component'
|
||||
import { AccountBlockBadgesComponent } from '../shared/shared-moderation/account-block-badges.component'
|
||||
|
||||
@Component({
|
||||
templateUrl: './video-channels.component.html',
|
||||
|
|
|
@ -203,7 +203,7 @@ class PeerTubePlugin extends Plugin {
|
|||
this.player.addClass('vjs-error-display-enabled')
|
||||
|
||||
// Google Bot may throw codecs, but it should not prevent indexing
|
||||
if (!/googlebot/i.test(navigator.userAgent)) {
|
||||
if (/googlebot/i.test(navigator.userAgent)) {
|
||||
console.error(this.player.error())
|
||||
} else {
|
||||
logger.error('Fatal error in player', this.player.error())
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
}
|
||||
|
||||
// Google Bot doesn't support our codecs, but it should not prevent indexing
|
||||
if (!/googlebot/i.test(navigator.userAgent)) {
|
||||
if (/googlebot/i.test(navigator.userAgent)) {
|
||||
console.error(err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue