Codota Logo
org.schabi.newpipe.extractor.channel
Code IndexAdd Codota to your IDE (free)

How to use org.schabi.newpipe.extractor.channel

Best Java code snippets using org.schabi.newpipe.extractor.channel (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: TeamNewPipe/NewPipe

public ChannelPlayQueue(final int serviceId,
            final String url,
            final String nextPageUrl,
            final List<StreamInfoItem> streams,
            final int index) {
  super(serviceId, url, nextPageUrl, streams, index);
}
origin: TeamNewPipe/NewPipe

public void selected(ChannelInfoItem selectedItem) {
  final FragmentManager fragmentManager = getFM();
  NavigationHelper.openChannelFragment(fragmentManager,
      selectedItem.getServiceId(),
      selectedItem.getUrl(),
      selectedItem.getName());
}
origin: TeamNewPipe/NewPipe

private void shareChannel (ChannelInfoItem selectedItem) {
  shareUrl(selectedItem.getName(), selectedItem.getUrl());
}
origin: TeamNewPipe/NewPipe

  private boolean isSubscriptionUpToDate(final ChannelInfo info, final SubscriptionEntity entity) {
    return info.getUrl().equals(entity.getUrl()) &&
        info.getServiceId() == entity.getServiceId() &&
        info.getName().equals(entity.getName()) &&
        info.getAvatarUrl().equals(entity.getAvatarUrl()) &&
        info.getDescription().equals(entity.getDescription()) &&
        info.getSubscriberCount() == entity.getSubscriberCount();
  }
}
origin: TeamNewPipe/NewPipe

@Ignore
public ChannelInfoItem toChannelInfoItem() {
  ChannelInfoItem item = new ChannelInfoItem(getServiceId(), getUrl(), getName());
  item.setThumbnailUrl(getAvatarUrl());
  item.setSubscriberCount(getSubscriberCount());
  item.setDescription(getDescription());
  return item;
}
origin: TeamNewPipe/NewPipe

@SuppressLint("CheckResult")
private void deleteChannel (ChannelInfoItem selectedItem) {
  subscriptionService.subscriptionTable()
      .getSubscription(selectedItem.getServiceId(), selectedItem.getUrl())
      .toObservable()
      .observeOn(Schedulers.io())
      .subscribe(getDeleteObserver());
  Toast.makeText(activity, getString(R.string.channel_unsubscribed), Toast.LENGTH_SHORT).show();
}
origin: TeamNewPipe/NewPipe

private PlayQueue getPlayQueue(final int index) {
  final List<StreamInfoItem> streamItems = new ArrayList<>();
  for(InfoItem i : infoListAdapter.getItemsList()) {
    if(i instanceof StreamInfoItem) {
      streamItems.add((StreamInfoItem) i);
    }
  }
  return new ChannelPlayQueue(
      currentInfo.getServiceId(),
      currentInfo.getUrl(),
      currentInfo.getNextPageUrl(),
      streamItems,
      index
  );
}
origin: TeamNewPipe/NewPipe

  protected String getDetailLine(final ChannelInfoItem item) {
    String details = "";
    if (item.getSubscriberCount() >= 0) {
      details += Localization.shortSubscriberCount(itemBuilder.getContext(),
          item.getSubscriberCount());
    }
    return details;
  }
}
origin: TeamNewPipe/NewPipe

public Completable updateChannelInfo(final ChannelInfo info) {
  final Function<List<SubscriptionEntity>, CompletableSource> update = new Function<List<SubscriptionEntity>, CompletableSource>() {
    @Override
    public CompletableSource apply(@NonNull List<SubscriptionEntity> subscriptionEntities) {
      if (DEBUG) Log.d(TAG, "updateChannelInfo() called with: subscriptionEntities = [" + subscriptionEntities + "]");
      if (subscriptionEntities.size() == 1) {
        SubscriptionEntity subscription = subscriptionEntities.get(0);
        // Subscriber count changes very often, making this check almost unnecessary.
        // Consider removing it later.
        if (!isSubscriptionUpToDate(info, subscription)) {
          subscription.setData(info.getName(), info.getAvatarUrl(), info.getDescription(), info.getSubscriberCount());
          return Completable.fromRunnable(() -> subscriptionTable().update(subscription));
        }
      }
      return Completable.complete();
    }
  };
  return subscriptionTable().getSubscription(info.getServiceId(), info.getUrl())
      .firstOrError()
      .flatMapCompletable(update);
}
origin: TeamNewPipe/NewPipe

public static Single<ChannelInfo> getChannelInfo(final int serviceId,
                         final String url,
                         boolean forceLoad) {
  checkServiceId(serviceId);
  return checkCache(forceLoad, serviceId, url, Single.fromCallable(() ->
      ChannelInfo.getInfo(NewPipe.getService(serviceId), url)));
}
origin: TeamNewPipe/NewPipe

@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
  super.setUserVisibleHint(isVisibleToUser);
  if(activity != null
      && useAsFrontPage
      && isVisibleToUser) {
    setTitle(currentInfo != null ? currentInfo.getName() : name);
  }
}
origin: TeamNewPipe/NewPipe

@Override
public void updateFromItem(final InfoItem infoItem) {
  super.updateFromItem(infoItem);
  if (!(infoItem instanceof ChannelInfoItem)) return;
  final ChannelInfoItem item = (ChannelInfoItem) infoItem;
  itemChannelDescriptionView.setText(item.getDescription());
}
origin: TeamNewPipe/NewPipe

private void openRssFeed() {
  final ChannelInfo info = currentInfo;
  if(info != null) {
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(info.getFeedUrl()));
    startActivity(intent);
  }
}
origin: TeamNewPipe/NewPipe

  @Override
  protected String getDetailLine(final ChannelInfoItem item) {
    String details = super.getDetailLine(item);

    if (item.getStreamCount() >= 0) {
      String formattedVideoAmount = Localization.localizeStreamCount(itemBuilder.getContext(),
          item.getStreamCount());

      if (!details.isEmpty()) {
        details += " • " + formattedVideoAmount;
      } else {
        details = formattedVideoAmount;
      }
    }
    return details;
  }
}
origin: TeamNewPipe/NewPipe

@Override
public void onSuccess(final ChannelInfo channelInfo) {
  if (infoListAdapter == null || channelInfo.getRelatedItems().isEmpty()) {
    onDone();
    return;
  }
  final InfoItem item = channelInfo.getRelatedItems().get(0);
  // Keep requesting new items if the current one already exists
  boolean itemExists = doesItemExist(infoListAdapter.getItemsList(), item);
  if (!itemExists) {
    infoListAdapter.addInfoItem(item);
    //updateSubscription(channelInfo);
  } else {
    requestFeed(1);
  }
  onDone();
}
origin: TeamNewPipe/NewPipe

public static Single<InfoItemsPage> getMoreChannelItems(final int serviceId,
                             final String url,
                             final String nextStreamsUrl) {
  checkServiceId(serviceId);
  return Single.fromCallable(() ->
      ChannelInfo.getMoreItems(NewPipe.getService(serviceId), url, nextStreamsUrl));
}
origin: TeamNewPipe/NewPipe

  @Ignore
  public static SubscriptionEntity from(@NonNull ChannelInfo info) {
    SubscriptionEntity result = new SubscriptionEntity();
    result.setServiceId(info.getServiceId());
    result.setUrl(info.getUrl());
    result.setData(info.getName(), info.getAvatarUrl(), info.getDescription(), info.getSubscriberCount());
    return result;
  }
}
origin: TeamNewPipe/NewPipe

  @Override
  public void selected(ChannelInfoItem selectedItem) {
    try {
      onItemSelected(selectedItem);
      NavigationHelper.openChannelFragment(getFM(),
          selectedItem.getServiceId(),
          selectedItem.getUrl(),
          selectedItem.getName());
    } catch (Exception e) {
      ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
    }
  }
});
origin: TeamNewPipe/NewPipe

private Consumer<Notification<ChannelInfo>> getNotificationsConsumer() {
  return notification -> {
    if (notification.isOnNext()) {
      String name = notification.getValue().getName();
      eventListener.onItemCompleted(!TextUtils.isEmpty(name) ? name : "");
    } else if (notification.isOnError()) {
      final Throwable error = notification.getError();
      final Throwable cause = error.getCause();
      if (error instanceof IOException) {
        throw (IOException) error;
      } else if (cause != null && cause instanceof IOException) {
        throw (IOException) cause;
      }
      eventListener.onItemCompleted("");
    }
  };
}
origin: TeamNewPipe/NewPipe

private Consumer<List<SubscriptionEntity>> getSubscribeUpdateMonitor(final ChannelInfo info) {
  return (List<SubscriptionEntity> subscriptionEntities) -> {
    if (DEBUG)
      Log.d(TAG, "subscriptionService.subscriptionTable.doOnNext() called with: subscriptionEntities = [" + subscriptionEntities + "]");
    if (subscribeButtonMonitor != null) subscribeButtonMonitor.dispose();
    if (subscriptionEntities.isEmpty()) {
      if (DEBUG) Log.d(TAG, "No subscription to this channel!");
      SubscriptionEntity channel = new SubscriptionEntity();
      channel.setServiceId(info.getServiceId());
      channel.setUrl(info.getUrl());
      channel.setData(info.getName(),
          info.getAvatarUrl(),
          info.getDescription(),
          info.getSubscriberCount());
      subscribeButtonMonitor = monitorSubscribeButton(headerSubscribeButton, mapOnSubscribe(channel));
    } else {
      if (DEBUG) Log.d(TAG, "Found subscription to this channel!");
      final SubscriptionEntity subscription = subscriptionEntities.get(0);
      subscribeButtonMonitor = monitorSubscribeButton(headerSubscribeButton, mapOnUnsubscribe(subscription));
    }
  };
}
org.schabi.newpipe.extractor.channel

Most used classes

  • ChannelInfoItem
  • ChannelInfo
  • ChannelExtractor
  • ChannelInfoItemExtractor
  • ChannelInfoItemsCollector
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now