<h3id="importand-notes-about-linkhandler">Importand notes about LinkHandler:</h3>
<ul>
<li>A simple <code>LinkHandler</code> will contain the default URL, the ID and the original url.</li>
<li><code>LinkHandler</code> are ReadOnly</li>
<li>LinkHandler are also used to determine which part of the extractor can handle a certain link.</li>
<li>In order to get one you must either call
<ahref="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/LinkHandlerFactory.html#fromUrl-java.lang.String-">fromUrl()</a> or <ahref="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/LinkHandlerFactory.html#fromId-java.lang.String-">fromId()</a> of the the coresponding <code>LinkHandlerFactory</code>.</li>
<li>Every type of Type of Resource has its own LinkHandlerFactory. Eg. YoutubeStreamLinkHandler, YoutubeChannelLinkHandler, etc.</li>
</ul>
<h3id="usage">Usage</h3>
<p>So the typical Usage for getting a LinkHandler would look like this.</p>
<pre><codeclass="java">LinkHandlerFactory myLinkHandlerFactory = new MyStreamLinkHandlerFactory();
which inherits from LinkHandler and adds the fields <ahref="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandler.html#contentFilters">ContentFilter</a>
which is used to filter by resource type like stream or playlist, and
which is used to sort by name, date or view count.</p>
<p>ListLinkHandler are also created by overriding the <ahref="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html">ListLinkHandlerFactory</a>
additionally to the abstract methods this factory inherits from the LinkHandlerFactory you can override
and <ahref="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html#getAvailableSortFilter--">getAvailableSortFilter()</a>.
Through these you can tell the front end which kind of filter your service support.</p>
<p>You can not point to a search request with an ID like you point to a playlist or a channel, simply because one and the
same search request might have a changing outcome deepening on the country or the time you send the request. This is
why the idea of an "ID" is replaced by a "SearchString" in the <ahref="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandler.html">SearchQueryHandler</a>
These work like regular ListLinkHandler, accept that you don't have to implement the methodes <code>onAcceptUrl()</code>
and <code>getId()</code> when overriding <ahref="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandlerFactory.html">SearchQueryHandlerFactory</a>.</p>
<ahref="../04_Run_changes_in_App/"class="btn btn-neutral float-right"title="Run the changes in the App">Next <spanclass="icon icon-circle-arrow-right"></span></a>
<ahref="../01_Concept_of_the_extractor/"class="btn btn-neutral"title="Concept of the Extractor"><spanclass="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<divrole="contentinfo">
<!-- Copyright etc -->
</div>
Built with <ahref="http://www.mkdocs.org">MkDocs</a> using a <ahref="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.