├── .github └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── README.md ├── assets ├── InfoItemsCollector_objectdiagram.dia ├── feature_branch.dia ├── hotfix_branch.dia ├── merge_into_dev.dia ├── rebase_back_hotfix.dia ├── rebase_back_release.dia └── release_branch.dia ├── ci ├── build-requirements.txt ├── docker-build.sh ├── docker-linkcheck.sh └── linkcheck-requirements.txt ├── copyright ├── docs ├── 00_Prepare_everything.md ├── 01_Concept_of_the_extractor.md ├── 02_Concept_of_LinkHandler.md ├── 03_Implement_a_service.md ├── 04_Run_changes_in_App.md ├── 05_Mock_tests.md ├── 06_releasing.md ├── 07_release_instructions.md ├── 08_documentation.md ├── 09_maintainers_view.md ├── img │ ├── InfoItemsCollector_objectdiagram.svg │ ├── check_path.png │ ├── could_not_decrypt.png │ ├── draft_name.png │ ├── feature_branch.svg │ ├── hotfix_branch.svg │ ├── jitpack_fail.png │ ├── kde_in_a_nutshell.jpg │ ├── merge_into_dev.svg │ ├── onedoes.jpg │ ├── prepare_tests_passed.png │ ├── rebase_back_hotfix.svg │ ├── rebase_back_release.svg │ ├── release_branch.svg │ ├── select_gradle.png │ ├── select_gradle_wrapper.png │ ├── sync_ok.png │ ├── termux_files.png │ └── weblate.png ├── index.md └── media │ └── how_to_jitpack.mp4 ├── linkcheck.py ├── mkdocs.yml └── theme ├── css ├── github.min.css ├── highlight.css ├── local_fonts.css └── theme_child.css ├── fonts ├── Inconsolata-Bold.ttf ├── Inconsolata-Regular.ttf ├── Lato-Bold.ttf ├── Lato-BoldItalic.ttf ├── Lato-Italic.ttf ├── Lato-Regular.ttf ├── RobotoSlab-Bold.ttf └── RobotoSlab-Regular.ttf ├── img └── favicon.ico ├── js └── highlight.min.js └── main.html /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Build docs 18 | run: bash ci/docker-build.sh 19 | 20 | 21 | linkcheck: 22 | runs-on: ubuntu-latest 23 | 24 | steps: 25 | - uses: actions/checkout@v2 26 | 27 | - name: Verify links 28 | run: bash ci/docker-linkcheck.sh 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | site/ 3 | *.*swp 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | NewPipe Tutorial 2 | ================ 3 | 4 | [![travis_build_state](https://api.travis-ci.org/TeamNewPipe/documentation.svg?branch=master)](https://travis-ci.org/TeamNewPipe/documentation) 5 | 6 | This is the [tutorial](https://teamnewpipe.github.io/documentation/) for the [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor). 7 | It is for those who want to write their own service, or use NewPipeExtractor in their own projects. 8 | 9 | This tutorial and the documentation are in an early state. So [feedback](https://github.com/TeamNewPipe/documentation/issues) is always welcome :D 10 | 11 | The tutorial is created using [`mkdocs`](http://www.mkdocs.org/). You can test and host it your self by running `mkdocs serve` in the root 12 | directory of this project. If you want to deploy your changes and you are one of the maintainers you can run `mkdocs gh-deploy && git push`. 13 | 14 | ## License 15 | 16 | [![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](http://www.gnu.org/licenses/gpl-3.0.en.html) 17 | 18 | NewPipe is Free Software: You can use, study share and improve it at your 19 | will. Specifically you can redistribute and/or modify it under the terms of the 20 | [GNU General Public License](https://www.gnu.org/licenses/gpl.html) as 21 | published by the Free Software Foundation, either version 3 of the License, or 22 | (at your option) any later version. 23 | -------------------------------------------------------------------------------- /assets/InfoItemsCollector_objectdiagram.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/assets/InfoItemsCollector_objectdiagram.dia -------------------------------------------------------------------------------- /assets/feature_branch.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/assets/feature_branch.dia -------------------------------------------------------------------------------- /assets/hotfix_branch.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/assets/hotfix_branch.dia -------------------------------------------------------------------------------- /assets/merge_into_dev.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/assets/merge_into_dev.dia -------------------------------------------------------------------------------- /assets/rebase_back_hotfix.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/assets/rebase_back_hotfix.dia -------------------------------------------------------------------------------- /assets/rebase_back_release.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/assets/rebase_back_release.dia -------------------------------------------------------------------------------- /assets/release_branch.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/assets/release_branch.dia -------------------------------------------------------------------------------- /ci/build-requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs 2 | -------------------------------------------------------------------------------- /ci/docker-build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o pipefail 5 | set -x 6 | 7 | this_dir="$(readlink -f -- "$(dirname -- "${BASH_SOURCE[0]}")")" 8 | image="python:3-alpine" 9 | 10 | # as we use a pipe to stdin and thus cannot use -it, Ctrl-C does not work by default 11 | # turns out that combining -i with --init solves that problem 12 | # see https://stackoverflow.com/a/60812082 13 | docker run --rm -i -v "$this_dir"/..:/ws -w /ws --init "$image" sh <<\EOF 14 | pip install -r ci/build-requirements.txt 15 | mkdocs build 16 | EOF 17 | -------------------------------------------------------------------------------- /ci/docker-linkcheck.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o pipefail 5 | set -x 6 | 7 | this_dir="$(readlink -f -- "$(dirname -- "${BASH_SOURCE[0]}")")" 8 | image="python:3-alpine" 9 | 10 | # as we use a pipe to stdin and thus cannot use -it, Ctrl-C does not work by default 11 | # turns out that combining -i with --init solves that problem 12 | # see https://stackoverflow.com/a/60812082 13 | docker run --rm -i -v "$this_dir"/..:/ws -w /ws --init "$image" sh <<\EOF 14 | pip install -r ci/linkcheck-requirements.txt 15 | python linkcheck.py 16 | EOF 17 | -------------------------------------------------------------------------------- /ci/linkcheck-requirements.txt: -------------------------------------------------------------------------------- 1 | Requests>=2.19.1 2 | -------------------------------------------------------------------------------- /copyright: -------------------------------------------------------------------------------- 1 | Copyright: 2018 Christian Schabesberger 2 | 3 | License: GPL-3.0+ 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | -------------------------------------------------------------------------------- /docs/00_Prepare_everything.md: -------------------------------------------------------------------------------- 1 | # Before You Start 2 | 3 | These documents will guide you through the process of understanding or creating your own Extractor 4 | service of which will enable NewPipe to access additional streaming services, such as the currently supported YouTube, SoundCloud and MediaCCC. 5 | The whole documentation consists of this page and [Jdoc](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/) setup, which explains the general concept of the NewPipeExtractor. 6 | 7 | __IMPORTANT!!!__ This is likely to be the worst documentation you have ever read, so do not hesitate to 8 | [report](https://github.com/teamnewpipe/documentation/issues) if 9 | you find any spelling errors, incomplete parts or you simply don't understand something. We are an open community 10 | and are open for everyone to help :) 11 | 12 | ## Setting Up Your Dev Environment 13 | 14 | First and foremost, you need to meet the following conditions in order to write your own service. 15 | 16 | ### What You Need to Know: 17 | 18 | - A basic understanding of __[Git](https://try.github.io)__ 19 | - Good __[Java](https://whatpixel.com/best-java-books/)__ knowledge 20 | - A good understanding of __[web technology](https://www.w3schools.com/)__ 21 | - A basic understanding of __[unit testing](https://www.vogella.com/tutorials/JUnit/article.html)__ and __[JUnit](https://junit.org/)__ 22 | - A thorough understanding of how to [contribute](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md#code-contribution) to the __NewPipe project__ 23 | 24 | ### Tools/Programs You Will Need: 25 | 26 | - A dev environment/IDE that supports: 27 | - __[Git](https://git-scm.com/downloads/guis)__ 28 | - __[Java 8](https://adoptium.net/?variant=openjdk8&jvmVariant=hotspot)__ 29 | - __[Gradle](https://gradle.org/)__ 30 | - __[Unit testing](https://junit.org/junit5/)__ 31 | - [IDEA Community](https://www.jetbrains.com/idea/) (Strongly recommended, but not required) 32 | - A __[Github](https://github.com/)__ account 33 | - A lot of patience and excitement ;D 34 | 35 | After making sure all these conditions are provided, fork the [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor) 36 | using the [fork button](https://github.com/TeamNewPipe/NewPipeExtractor#fork-destination-box). 37 | This is so you have a personal repository to develop on. Next, clone this repository into your local folder in which you want to work in. 38 | Then, import the cloned project into your [IDE](https://www.jetbrains.com/help/idea/configuring-projects.html#importing-project) 39 | and [run it.](https://www.jetbrains.com/help/idea/performing-tests.html) 40 | If all the checks are green, you did everything right! You can proceed to the next chapter. 41 | 42 | ### Importing the NewPipe Extractor in IntelliJ IDEA 43 | If you use IntelliJ IDEA, you should know the easy way of importing the NewPipe extractor. If you don't, here's how to do it: 44 | 45 | 1. `git clone` the extractor onto your computer locally. 46 | 2. Start IntelliJ Idea and click `Import Project`. 47 | 3. Select the root directory of the NewPipe Extractor. 48 | 4. Select "__Import Project from external Model__" and then choose __Gradle__. 49 | ![import from gradle image](img/select_gradle.png) 50 | 5. In the next window, select "__Use gradle 'wrapper' task configuration__". 51 | ![use gradle 'wrapper' task configuration checkbox](img/select_gradle_wrapper.png) 52 | 53 | ### Running "test" in Android Studio/IntelliJ IDEA 54 | 55 | Go to _Run_ > _Edit Configurations_ > _Add New Configuration_ and select "Gradle". 56 | As Gradle Project, select NewPipeExtractor. As a task, add "test". Now save and you should be able to run. 57 | 58 | ![tests passed on idea](img/prepare_tests_passed.png) 59 | 60 | # Inclusion Criteria for Services 61 | 62 | After creating you own service, you will need to submit it to our [NewPipeExtractor](https://github.com/teamnewpipe/newpipeextractor) 63 | repository. However, in order to include your changes, you need to follow these rules: 64 | 65 | 1. Stick to our [code contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md#code-contribution). 66 | 2. Do not send services that present content we [don't allow](#content-that-is-not-permitted) on NewPipe. 67 | 3. You must be willing to maintain your service after submission. 68 | 4. Be patient and make the requested changes when one of our maintainers rejects your code. 69 | 70 | ## Content That is Permitted 71 | 72 | - Any content that is not in the [list of prohibited content](#content-that-is-not-permitted). 73 | - Any kind of pornography or NSFW content that does not violate US law. However, porn services will not be added to the official NewPipe app. 74 | - Advertising, which may need to be approved beforehand. 75 | 76 | ## Content That is NOT Permitted 77 | 78 | - Content that is considered NSFL (Not Safe For Life). 79 | - Content that is prohibited by US federal law (Sexualization of minors, any form of violence, violations of human rights, etc). 80 | - Copyrighted media, without the consent of the copyright holder/publisher. 81 | -------------------------------------------------------------------------------- /docs/01_Concept_of_the_extractor.md: -------------------------------------------------------------------------------- 1 | # Concept of the Extractor 2 | 3 | ## The Collector/Extractor Pattern 4 | 5 | Before you start coding your own service, you need to understand the basic concept of the extractor itself. There is a pattern 6 | you will find all over the code, called the __extractor/collector__ pattern. The idea behind it is that 7 | the [extractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/Extractor.html) 8 | would produce fragments of data, and the collector would collect them and assemble that data into a readable format for the front end. 9 | The collector also controls the parsing process, and takes care of error handling. So, if the extractor fails at any 10 | point, the collector will decide whether or not it should continue parsing. This requires the extractor to be made out of 11 | multiple methods, one method for every data field the collector wants to have. The collectors are provided by NewPipe. 12 | You need to take care of the extractors. 13 | 14 | ### Usage in the Front End 15 | 16 | A typical call for retrieving data from a website would look like this: 17 | ``` java 18 | Info info; 19 | try { 20 | // Create a new Extractor with a given context provided as parameter. 21 | Extractor extractor = new Extractor(some_meta_info); 22 | // Retrieves the data form extractor and builds info package. 23 | info = Info.getInfo(extractor); 24 | } catch(Exception e) { 25 | // handle errors when collector decided to break up extraction 26 | } 27 | ``` 28 | 29 | ### Typical Implementation of a Single Data Extractor 30 | 31 | The typical implementation of a single data extractor, on the other hand, would look like this: 32 | ``` java 33 | class MyExtractor extends FutureExtractor { 34 | 35 | public MyExtractor(RequiredInfo requiredInfo, ForExtraction forExtraction) { 36 | super(requiredInfo, forExtraction); 37 | 38 | ... 39 | } 40 | 41 | @Override 42 | public void fetch() { 43 | // Actually fetch the page data here 44 | } 45 | 46 | @Override 47 | public String someDataField() 48 | throws ExtractionException { //The exception needs to be thrown if something failed 49 | // get piece of information and return it 50 | } 51 | 52 | ... // More datafields 53 | } 54 | ``` 55 | 56 | ## Collector/Extractor Pattern for Lists 57 | 58 | Information can be represented as a list. In NewPipe, a list is represented by an 59 | [InfoItemsCollector](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/InfoItemsCollector.html). 60 | An InfoItemsCollector will collect and assemble a list of [InfoItem](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/InfoItem.html). 61 | For each item that should be extracted, a new Extractor must be created, and given to the InfoItemsCollector via [commit()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/InfoItemsCollector.html#commit-E-). 62 | 63 | ![InfoItemsCollector_objectdiagram.svg](img/InfoItemsCollector_objectdiagram.svg) 64 | 65 | If you are implementing a list in your service you need to implement an [InfoItemExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/Extractor.html), 66 | that will be able to retrieve data for one and only one InfoItem. This extractor will then be _comitted_ to the __InfoItemsCollector__ that can collect the type of InfoItems you want to generate. 67 | 68 | A common implementation would look like this: 69 | ``` 70 | private SomeInfoItemCollector collectInfoItemsFromElement(Element e) { 71 | // See *Some* as something like Stream or Channel 72 | // e.g. StreamInfoItemsCollector, and ChannelInfoItemsCollector are provided by NP 73 | SomeInfoItemCollector collector = new SomeInfoItemCollector(getServiceId()); 74 | 75 | for(final Element li : element.children()) { 76 | collector.commit(new InfoItemExtractor() { 77 | @Override 78 | public String getName() throws ParsingException { 79 | ... 80 | } 81 | 82 | @Override 83 | public String getUrl() throws ParsingException { 84 | ... 85 | } 86 | 87 | ... 88 | } 89 | return collector; 90 | } 91 | 92 | ``` 93 | 94 | ## ListExtractor 95 | 96 | There is more to know about lists: 97 | 98 | 1. When a streaming site shows a list of items, it usually offers some additional information about that list like its title, a thumbnail, 99 | and its creator. Such info can be called __list header__. 100 | 101 | 2. When a website shows a long list of items it usually does not load the whole list, but only a part of it. In order to get more items you may have to click on a next page button, or scroll down. 102 | 103 | Both of these Problems are fixed by the [ListExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/ListExtractor.html) which takes care about extracting additional metadata about the list, 104 | and by chopping down lists into several pages, so called [InfoItemsPage](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/ListExtractor.InfoItemsPage.html)s. 105 | Each page has its own URL, and needs to be extracted separately. 106 | 107 | 108 | For extracting list header information a `ListExtractor` behaves like a regular extractor. For handling `InfoItemsPages` it adds methods 109 | such as: 110 | 111 | - [getInitialPage()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/ListExtractor.html#getInitialPage--) 112 | which will return the first page of InfoItems. 113 | - [getNextPageUrl()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/ListExtractor.html#getNextPageUrl--) 114 | If a second Page of InfoItems is available this will return the URL pointing to them. 115 | - [getPage()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/ListExtractor.html#getPage-java.lang.String-) 116 | returns a ListExtractor.InfoItemsPage by its URL which was retrieved by the `getNextPageUrl()` method of the previous page. 117 | 118 | 119 | The reason why the first page is handled special is because many Websites such as YouTube will load the first page of 120 | items like a regular web page, but all the others as an AJAX request. 121 | 122 | An InfoItemsPage itself has two constructors which take these parameters: 123 | - The __InfoitemsCollector__ of the list that the page should represent 124 | - A __nextPageUrl__ which represents the url of the following page (may be null if not page follows). 125 | - Optionally __errors__ which is a list of Exceptions that may have happened during extracton. 126 | 127 | Here is a simplified reference implementation of a list extractor that only extracts pages, but not metadata: 128 | 129 | ``` 130 | class MyListExtractor extends ListExtractor { 131 | ... 132 | private Document document; 133 | 134 | ... 135 | 136 | public InfoItemsPage getPage(pageUrl) 137 | throws ExtractionException { 138 | SomeInfoItemCollector collector = new SomeInfoItemCollector(getServiceId()); 139 | document = myFunctionToGetThePageHTMLWhatever(pageUrl); 140 | 141 | //remember this part from the simple list extraction 142 | for(final Element li : document.children()) { 143 | collector.commit(new InfoItemExtractor() { 144 | @Override 145 | public String getName() throws ParsingException { 146 | ... 147 | } 148 | 149 | @Override 150 | public String getUrl() throws ParsingException { 151 | ... 152 | } 153 | ... 154 | } 155 | return new InfoItemsPage(collector, myFunctionToGetTheNextPageUrl(document)); 156 | } 157 | 158 | public InfoItemsPage getInitialPage() { 159 | //document here got initialized by the fetch() function. 160 | return getPage(getTheCurrentPageUrl(document)); 161 | } 162 | ... 163 | } 164 | ``` 165 | -------------------------------------------------------------------------------- /docs/02_Concept_of_LinkHandler.md: -------------------------------------------------------------------------------- 1 | # Concept of the LinkHandler 2 | 3 | The [LinkHandler](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/LinkHandler.html) 4 | represent links to resources like videos, search requests, channels, etc. 5 | The idea is that a video can have multiple links pointing to it, but it has 6 | one unique ID that represents it, like this example: 7 | 8 | [oHg5SJYRHA0](https://www.youtube.com/watch?v=oHg5SJYRHA0) can be represented as: 9 | 10 | - [https://www.youtube.com/watch?v=oHg5SJYRHA0](https://www.youtube.com/watch?v=oHg5SJYRHA0) (the default URL for YouTube) 11 | - [https://youtu.be/oHg5SJYRHA0](https://youtu.be/oHg5SJYRHA0) (the shortened link) 12 | - [https://m.youtube.com/watch?v=oHg5SJYRHA0](https://m.youtube.com/watch?v=oHg5SJYRHA0) (the link for mobile devices) 13 | 14 | ### Important notes about LinkHandler 15 | - A simple `LinkHandler` will contain the default URL, the ID, and the original URL. 16 | - `LinkHandler`s are read only. 17 | - `LinkHandler`s are also used to determine which part of the extractor can handle a certain link. 18 | - In order to get one you must either call 19 | [fromUrl()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/LinkHandlerFactory.html#fromUrl-java.lang.String-) or [fromId()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/LinkHandlerFactory.html#fromId-java.lang.String-) of the the corresponding `LinkHandlerFactory`. 20 | - Every type of resource has its own `LinkHandlerFactory`. Eg. YoutubeStreamLinkHandler, YoutubeChannelLinkHandler, etc. 21 | 22 | ### Usage 23 | 24 | The typical usage for obtaining a LinkHandler would look like this: 25 | ```java 26 | LinkHandlerFactory myLinkHandlerFactory = new MyStreamLinkHandlerFactory(); 27 | LinkHandler myVideo = myLinkHandlerFactory.fromUrl("https://my.service.com/the_video"); 28 | ``` 29 | 30 | ### Implementation 31 | 32 | In order to use LinkHandler for your service, you must override the appropriate LinkHandlerFactory. eg: 33 | 34 | ```java 35 | class MyStreamLinkHandlerFactory extends LinkHandlerFactory { 36 | 37 | @Override 38 | public String getId(String url) throws ParsingException { 39 | // Return the ID based on the URL. 40 | } 41 | 42 | @Override 43 | public String getUrl(String id) throws ParsingException { 44 | // Return the URL based on the ID given. 45 | } 46 | 47 | @Override 48 | public boolean onAcceptUrl(String url) throws ParsingException { 49 | // Return true if this LinkHandlerFactory can handle this type of link. 50 | } 51 | } 52 | ``` 53 | 54 | ### ListLinkHandler and SearchQueryHandler 55 | 56 | List based resources, like channels and playlists, can be sorted and filtered. 57 | Therefore these type of resources don't just use a LinkHandler, but a class called 58 | [ListLinkHandler](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandler.html), 59 | which inherits from LinkHandler and adds the field [ContentFilter](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandler.html#contentFilters), 60 | which is used to filter by resource type, like stream or playlist, and 61 | [SortFilter](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandler.html#sortFilter), 62 | which is used to sort by name, date, or view count. 63 | 64 | __!!ATTENTION!!__ Be careful when you implement a content filter: No selected filter equals all filters selected. If your get an empty content filter list in your extractor, make sure you return everything. By all means, use "if" 65 | statements like `contentFilter.contains("video") || contentFilter.isEmpty()`. 66 | 67 | ListLinkHandler are also created by overriding the [ListLinkHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html) 68 | additionally to the abstract methods this factory inherits from the LinkHandlerFactory you can override 69 | [getAvailableContentFilter()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html#getAvailableContentFilter--) 70 | and [getAvailableSortFilter()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html#getAvailableSortFilter--). 71 | Through these you can tell the front end which kind of filter your service supports. 72 | 73 | 74 | #### SearchQueryHandler 75 | 76 | You cannot point to a search request with an ID like you point to a playlist or a channel, simply because one and the 77 | same search request might have a different outcome depending on the country or the time you send the request. This is 78 | why the idea of an "ID" is replaced by a "SearchString" in the [SearchQueryHandler](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandler.html). 79 | These work like regular ListLinkHandler, except that you don't have to implement the methods `onAcceptUrl()` 80 | and `getId()` when overriding [SearchQueryHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandlerFactory.html). 81 | -------------------------------------------------------------------------------- /docs/03_Implement_a_service.md: -------------------------------------------------------------------------------- 1 | # Implementing a Service 2 | 3 | Services, or better service connectors, are the parts of NewPipe which communicate with an actual service like YouTube. 4 | This page will describe how you can implement and add your own services to the extractor. Please make sure you read and understand the 5 | [Concept of Extractors](https://teamnewpipe.github.io/documentation/01_Concept_of_the_extractor/) 6 | and the [Concept of LinkHandler](https://teamnewpipe.github.io/documentation/02_Concept_of_LinkHandler/) 7 | before continuing. 8 | 9 | ### Required and Optional Parts 10 | Your service does not have to implement everything; some parts are optional. 11 | This is because not all services support every feature other services support. For example, it might be that a certain 12 | service does not support channels. If so, you can leave out the implementation of channels, and make the corresponding 13 | factory method of the your __StreamingService__ implementation return __null__. The frontend will handle the lack of 14 | having channels. 15 | 16 | However, if you start to implement one of the optional parts of the list below, you will have to implement all of its parts/classes. NewPipe will crash if you only implement the extractor for the list item of a channel, but not the channel extractor itself. 17 | 18 | __The Parts of a Service:__ 19 | 20 | - [Head of Service](#head-of-service) 21 | - [Stream](#stream) 22 | - [Search](#search) 23 | - [Playlist](#playlist) _(optional)_ 24 | - [Channel](#channel) _(optional)_ 25 | - [Kiosk](#kiosk) _(optional)_ 26 | 27 | ### Allowed Libraries 28 | 29 | The NewPipe Extractor already includes a lot of usable tools and external libraries that should make extracting easy. 30 | For some specific (tiny) tasks, Regex is allowed. Here you can take a look at the 31 | [Parser](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/utils/Parser.html), 32 | which will give you a little help with that. __Use Regex with care!!!__ Avoid it as often as possible. It's better to 33 | ask us to introduce a new library than start using Regex too often. 34 | 35 | - Html/XML Parsing: [jsoup](https://jsoup.org/apidocs/overview-summary.html) 36 | - JSON Parsing: [nanojson](https://github.com/mmastrac/nanojson#parser-example) 37 | - JavaScript Parsing/Execution: [Mozilla Rhino](https://github.com/mozilla/rhino) 38 | - Link detection in strings: [AutoLink](https://github.com/robinst/autolink-java) 39 | 40 | If you need to introduce new libraries, please tell us before you do so. 41 | 42 | ### Head of Service 43 | 44 | First of all, if you want to create a new service, you should create a new package below `org.schabi.newpipe.services` 45 | , with the name of your service as package name. 46 | 47 | __Parts Required to be Implemented:__ 48 | 49 | - [StreamingService](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/StreamingService.html) 50 | - [ServiceInfo](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/StreamingService.ServiceInfo.html) 51 | 52 | [StreamingService](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/StreamingService.html) 53 | is a factory class that will return objects of all important parts of your service. 54 | Every extractor, handler, and info type you add and should be part of your implementation, must be instantiated using an 55 | instance of this class. You can see it as a factory for all objects of your implementation. 56 | 57 | [ServiceInfo](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/StreamingService.ServiceInfo.html) 58 | will return some metadata about your service such as the name, capabilities, the author's name, and their 59 | email address for further notice and maintenance issues. Remember, after extending this class, you need to return an 60 | instance of it by through your implementation of 61 | [`StreamingService.getServiceInfo()`](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/StreamingService.html#getServiceInfo--). 62 | 63 | When these two classes are extended by you, you need to add your `StreamingService` to the 64 | [ServiceList](https://github.com/TeamNewPipe/NewPipeExtractor/blob/49c2eb51859a58e4bb5ead2d9d0771408f7d59d6/extractor/src/main/java/org/schabi/newpipe/extractor/ServiceList.java#L23) 65 | of NewPipe. This way, your service will become an official part of the NewPipe Extractor. 66 | Every service has an ID, which will be set when this list gets created. You need to set this ID by entering it in the constructor. 67 | So when adding your service just give it the ID of the previously last service in the list incremented by one. 68 | 69 | ### Stream 70 | 71 | Streams are considered single entities of video or audio. They have metadata like a title, a description, 72 | next/related videos, a thumbnail and comments. To obtain the URL to the actual stream data, as well as its metadata, 73 | StreamExtractor is used. The LinkHandlerFactory will represent a link to such a stream. StreamInfoItemExtractor will 74 | extract one item in a list of items representing such streams, like a search result or a playlist. 75 | Since every streaming service (obviously) provides streams, this is required to implement. Otherwise, your service was 76 | pretty useless :) 77 | 78 | __Parts Required to be Implemented:__ 79 | 80 | - [StreamExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/stream/StreamExtractor.html) 81 | - [StreamInfoItemExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.html) 82 | - [LinkHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/LinkHandlerFactory.html) 83 | 84 | ### Search 85 | The SearchExtractor is also required to be implemented. It will take a search query represented as 86 | [SearchQueryHandler](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandler.html) 87 | and return a list of search results. Since many services support suggestions as you type, you will also want to implement 88 | a __SuggestionExtractor__. This will make it possible for the frontend to also display a suggestion while typing. 89 | 90 | __Parts Required to be Implemented:__ 91 | 92 | - [SearchExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/search/SearchExtractor.html) 93 | - [SearchQueryHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandlerFactory.html) 94 | - [SuggestionExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/suggestion/SuggestionExtractor.html) _(optional)_ 95 | 96 | ### Playlist 97 | Playlists are lists of streams provided by the service (you might not have to be concerned over locally saved playlists, those will be handled by the frontend). 98 | A playlist may only contain __StreamInfoItems__, but no other __InfoItem__ types. 99 | 100 | __Parts Required to be Implemented:__ 101 | 102 | - [PlaylistExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.html) 103 | - [PlayListInfoItemExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/playlist/PlaylistExtractor.html) 104 | - [ListLinkHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html) 105 | 106 | ### Channel 107 | A Channel is mostly a [Playlist](#playlist), the only difference is that it does not only represent a simple list of streams, but also a 108 | user, a channel, or any entity that could be represented as a user. This is why the metadata supported by the ChannelExtractor 109 | differs from the one of a playlist. 110 | 111 | __Parts Required to be Implemented:__ 112 | 113 | - [ChannelExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/channel/ChannelExtractor.html) 114 | - [ChannelInfoItemExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/channel/ChannelExtractor.html) 115 | - [ListLinkHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html) 116 | 117 | ### Kiosk 118 | A kiosk is a list of __InfoItems__ which will be displayed on the main page of NewPipe. A kiosk is mostly similar to the content 119 | displayed on the main page of a video platform. A kiosk could be something like "Top 20", "Charts", "News", "Creators Selection" etc. 120 | Kiosks are controversial; many people may not like them. If you also don't like them, please consider your users and refrain from denying support for them. 121 | Your service would look pretty empty if you select it and no video is being displayed. Also, you should not override the preference of the user, 122 | since users of NewPipe can decide by the settings whether they want to see the kiosk page or not. 123 | 124 | #### Multiple Kiosks 125 | Most services will implement more than one kiosk, so a service might have a "Top 20" for different categories like "Country Music", "Techno", etc. 126 | This is why the extractor will let you implement multiple __KioskExtractors__. Since different kiosk pages might also differ 127 | with their HTML structure, every page you want to support has to be implemented as its own __KioskExtractor__. 128 | However, if the pages are similar, you can use the same implementation, but set the page type when you instantiate your __KioskExtractor__ 129 | through the __KioskList.KioskExtractorFactory__. 130 | 131 | Every kiosk you implement needs to be added to your __KioskList__ which you return with your 132 | __StreamingService__ implementation. 133 | 134 | It is also important to set the default kiosk. This will be the kiosk that will be shown by the first start of your service. 135 | 136 | An example implementation of the 137 | [getKioskList()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/StreamingService.html) 138 | could look like this: 139 | ```java 140 | @Override 141 | public KioskList getKioskList() throws ExtractionException { 142 | KioskList list = new KioskList(getServiceId()); 143 | 144 | list.addKioskEntry(new KioskList.KioskExtractorFactory() { 145 | @Override 146 | public KioskExtractor createNewKiosk(StreamingService streamingService, 147 | String url, 148 | String id, 149 | Localization local) 150 | throws ExtractionException { 151 | return new YoutubeTrendingExtractor(YoutubeService.this, 152 | new YoutubeTrendingLinkHandlerFactory().fromUrl(url), id, local); 153 | } 154 | }, new YoutubeTrendingLinkHandlerFactory(), "Trending"); 155 | 156 | list.setDefaultKiosk("Trending"); 157 | return list; 158 | } 159 | 160 | ``` 161 | 162 | __Parts Required to be Implemented:__ 163 | 164 | - [KioskList.KioskExtractorFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/kiosk/KioskList.KioskExtractorFactory.html) 165 | - [KioskExtractor](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/kiosk/KioskExtractor.html) 166 | - [ListLinkHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/ListLinkHandlerFactory.html) 167 | -------------------------------------------------------------------------------- /docs/04_Run_changes_in_App.md: -------------------------------------------------------------------------------- 1 | # Testing Your Changes in the App 2 | 3 | You should develop and test your changes with the JUnit environment that is 4 | provided by the NewPipe Extractor and IDEA. If you want to try it with 5 | the actual frontend, you need to follow these steps. 6 | 7 | ### Setup Android Studio 8 | 9 | First, you'll want to set up a working Android Studio environment. To do this, 10 | download Studio from [developer.android.com](https://developer.android.com/studio/), 11 | and follow the [instructions](https://developer.android.com/studio/install) on how to set it up. 12 | 13 | ### Get the NewPipe Code and Run it. 14 | 15 | In order to get it, you simply clone or download it from the current `dev` branch 16 | [github.com/TeamNewPipe/NewPipe.git](https://github.com/TeamNewPipe/NewPipe/archive/dev.zip). 17 | You can then build and run it following [these instructions](https://developer.android.com/studio/run/). 18 | Also, make sure you are comfortable with [adb](https://en.droidwiki.org/wiki/Android_Debug_Bridge) since 19 | you might experience some trouble running your compiled app on a real device, especially under Linux, where you 20 | sometimes have to adjust the udev rules in order to 21 | [make your device accessible](https://www.janosgyerik.com/adding-udev-rules-for-usb-debugging-android-devices/). 22 | 23 | ### Run Your Changes on the Extractor 24 | 25 | There are several ways to test your extractor version in NewPipe. We will show you the most convenient ones: 26 | 27 | #### Using local folder 28 | 29 | In NewPipe app root folder, edit [settings.gradle](https://github.com/TeamNewPipe/NewPipe/blob/dev/settings.gradle) file and add this: 30 | ``` 31 | includeBuild('../NewPipeExtractor') { 32 | dependencySubstitution { 33 | substitute module('com.github.TeamNewPipe:NewPipeExtractor') with project(':extractor') 34 | } 35 | } 36 | ``` 37 | `includeBuild` should have the relative path as argument. `../NewPipeExtractor` means one folder up in hierarchy, 38 | and the folder is exactly named `NewPipeExtractor`. If that's not the case, edit this part. 39 | 40 | #### Using JitPack 41 | 42 | Another way is to use [JitPack](https://jitpack.io). This is a build service that can build 43 | maven *.jar packages for Android and Java based on GitHub or GitLab repositories. 44 | 45 | To use the extractor through JitPack, you need to push it to your online repository of 46 | your copy that you host either on [GitHub](https://github.com) or [GitLab](https://gitlab.com). It's important to host 47 | it on one of both. To copy your repository URL in HTTP format, go to [JitPack](https://jitpack.io/) and paste it there. 48 | From here, you can grab the latest commit via `GET IT` button. 49 | I recommend not to use a SNAPSHOT, since I am not sure when snapshot is built. An "implementation" string will be generated 50 | for you. Copy this string and replace the `implementation 'com.github.TeamNewPipe:NewPipeExtractor:'` line in 51 | the file [/app/build.gradle](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle#L58) with it. 52 | 53 | 57 | 58 | If everything synced well, then you should only see a screen with OK signs. Now you can compile and run NewPipe 59 | with the new extractor. 60 | 61 | ![image_sync_ok](img/sync_ok.png) 62 | 63 | ### Troubleshooting 64 | 65 | If something went wrong on JitPack site, you can check their build log, by selecting the commit you tried to build and 66 | click on that little paper symbol next to the `GET IT` button. If it's red, it means that the build failed. 67 | ![jitpack failed to build](img/jitpack_fail.png) 68 | -------------------------------------------------------------------------------- /docs/05_Mock_tests.md: -------------------------------------------------------------------------------- 1 | # Mock Tests 2 | 3 | A web crawler is, by its very nature, dependent on the external service which it is crawling. 4 | In order to have a reliable CI pipeline, this external dependency needs to be removed. 5 | For this, there is a system in place to automatically save the requests made to a service, as well as the responses received. 6 | These can then be used in the CI pipeline to reliably test changes made to the Extractor, and avoid test failures due to API changes on the side of the service. 7 | 8 | ## Multiple downloader implementations 9 | 10 | There are multiple implementations of the abstract class `Downloader` 11 | 12 | 1. `DownloaderTestImpl` is used for running the test against the actual service. 13 | 2. `RecordingDownloader` is used to save the request and response to a file, thus creating the mock. 14 | 3. `MockDownloader` is used to answer requests using the saved mocks. 15 | 16 | ### Usage 17 | 18 | There are 2 ways to specify which downloader should be used. 19 | 20 | First one is passing the `-Ddownloader=` argument from the command line, where `value` can be one of 21 | [DownloaderType](https://github.com/TeamNewPipe/NewPipeExtractor/blob/dev/extractor/src/test/java/org/schabi/newpipe/downloader/DownloaderType.java) 22 | . The main use case is in the CI pipeline, like this: `./gradlew check --stacktrace -Ddownloader=MOCK`. 23 | Other than that it can also be used to mass generate mocks by specifying which package should be tested. For example, if 24 | one wanted to update all YouTube mocks: 25 | `gradle clean test --tests 'org.schabi.newpipe.extractor.services.youtube.*' -Ddownloader=RECORDING` 26 | 27 | The second way is changing the field `DownloaderFactory.DEFAULT_DOWNLOADER`. 28 | The default value is `DownloaderType.REAL` which should not be changed on the master branch. 29 | Locally one can change this to `DownloaderType.RECORDING`, run the tests and commit 30 | the generated mocks. 31 | This is the main use case for when developing locally. 32 | 33 | ### Mock only tests 34 | 35 | There are some things which cannot ever be tested reliably against an actual service. 36 | For example, tests for an upcoming livestream would fail after the livestream starts. 37 | 38 | For this, there is a marker interface `MockOnly`, and a custom TestRule `MockOnlyRule`. 39 | It skips the tests in the CI pipeline if they are not run with mocks. 40 | 41 | See `MockOnlyRule` for further details. 42 | 43 | Example usage: 44 | 45 | ``` java 46 | public static class TestClass { 47 | 48 | @Rule 49 | public MockOnlyRule rule = new MockOnlyRule(); 50 | 51 | @MockOnly 52 | @Test 53 | public void myTest() throws Exception { 54 | //assertions 55 | } 56 | } 57 | ``` -------------------------------------------------------------------------------- /docs/06_releasing.md: -------------------------------------------------------------------------------- 1 | # Releasing a New NewPipe Version 2 | 3 | This site is meant for those who want to maintain NewPipe, or just want to know how releasing works. 4 | 5 | ![one does not simply push to master](img/onedoes.jpg) 6 | 7 | ## Differences Between Regular and Hotfix Releases 8 | 9 | Depending on the service, NewPipe Extractor uses web crawling or internal APIs. 10 | Both are subject to arbitrary changes by the service providers, like YouTube, SoundCloud or PeerTube. 11 | When they change something, NewPipe Extractor and thus NewPipe break instantly. 12 | Therefore, maintainers need to act quickly when it happens, and reduce our downtime as 13 | much as possible. The entire release cycle is therefore designed around this issue. 14 | 15 | There is a difference between a release that introduces new features 16 | and a release that fixes an issue that occurred because YouTube, or some other service, 17 | changed their website (typically called a shutdown). 18 | Let's have a look at the characteristics of a __regular release__, 19 | and then the characteristics of a __hotfix release__. 20 | 21 | 22 | ## Regular Releases 23 | 24 | Regular releases are normal releases as they are done in any other app. 25 | Releases are always stored and tagged on __master__ branch. The latest commit on 26 | __master__ is always equal to the currently released version. No development is done on master. 27 | This ensures that we always have one branch with a stable/releasable version. 28 | 29 | ### Feature Branching 30 | The __dev__ branch is used for development. Pushing to __dev__ directly, however, is not allowed, 31 | since QA and testing should be done _before_ adding something to the branch. 32 | This ensures that the development version works as stable a possible. 33 | In order to change something on the app, one may want to __fork__ the dev branch 34 | and develop the changes in their own branch (this is called feature branching). 35 | 36 | ![feature_branching](img/feature_branch.svg) 37 | 38 | Make sure that both the dev branches, as well as the master branches of the extractor 39 | and the frontend, are compatible with each other. 40 | If the extractor's API is modified, make sure that frontend is compatible, 41 | or changed to become compatible, with these changes. 42 | If the PR that should make the frontend compatible 43 | again can not be merged, please do not merge the corresponding PR on the extractor either. 44 | This should make sure that any developer can run his changes on the fronted at any time. 45 | 46 | ### Merging Features/Bugfixes 47 | 48 | After finishing a feature, one should open up a __Pull Request__ to the dev branch. 49 | From here, a maintainer can do __Code review__ and __Quality Assurance (QA)__. 50 | If you are a maintainer, please take care about the code architecture 51 | so __corrosion__ or __code shifting__ can be prevented. 52 | Please also prioritize code quality over functionality. 53 | In short: cool function but bad code = no merge. Focus on keeping the code as clean as possible. 54 | 55 | ![merge_feature_into_dev](img/merge_into_dev.svg) 56 | 57 | An APK for __testing__ is provided by GitHub Actions for every PR. 58 | Please ensure that this APK is tested thoroughly to prevent introducing regressions. 59 | Testing features needs to take into account that NewPipe is used on a brought variety 60 | of Android versions from KitKat to the latest, on custom ROMs like Lineage OS, CalyxOS or /e/ 61 | and different devices like phones, tablets and TVs. 62 | 63 | Sometimes, the content of a PR changes over the time. 64 | Modify the PR's title if it does not represent the introduced changes anymore. 65 | After a maintainer merged the new feature into the dev branch, 66 | they should add the PR's title or a summary of the changes into the [release notes](#release-notes). 67 | 68 | ### Normal Releases 69 | 70 | Once there are enough changes, and the maintainers believe that NewPipe is ready 71 | for a new version, they should prepare a new release. 72 | Be aware of the rule that a release should never be done on a Friday. 73 | For NewPipe, this means: __Don't do a release if you don't have time for it!!!__ 74 | 75 | By following the steps listed in [Release instructions](../07_release_instructions), you can publish a stable version of NewPipe. 76 | 77 | ## Hotfix Releases 78 | 79 | ![this_is_fine](img/could_not_decrypt.png) 80 | 81 | As aforementioned, NewPipe heavily relies on external components and might break at a random point of time. 82 | In order to keep the NewPipe's downtime as low as possible, when such a shutdown happens, 83 | we allow __hotfixes__. 84 | 85 | 86 | - A hotfix allows work on the master branch instead of the dev branch. 87 | - A hotfix MUST __NOT__ contain any features or unrelated bugfixes. 88 | - A hotfix may only focus on fixing what caused the shutdown. 89 | 90 | ### Hotfix Branch 91 | 92 | Hotfixes work on the master branch. 93 | The dev branch has experimental changes that might have not been tested properly enough to be released, 94 | if at all. The master branch should always be the latest stable version of NewPipe. 95 | If the master branch breaks due to a shutdown, you should fix the master branch. 96 | Of course, you are not allowed to push to master directly, 97 | so you need to create a __hotfix__ branch. 98 | _If someone else is pushing a hotfix into master, and it works this can be considered as hotfix branch as well._ 99 | 100 | ![hotfix_branch](img/hotfix_branch.svg) 101 | 102 | ### Releasing 103 | 104 | If you fixed the issue and found it to be tested and reviewed well enough, you may publish a new version. 105 | You don't need to undergo the full release procedure of a regular release, which takes too much time. 106 | Keep in mind that if the hotfix might turn out to be broken after release, you should release another hotfix. 107 | It is important to release quickly for the sake of keeping NewPipe alive, and after all, 108 | a slightly broken version of NewPipe is better than a non-functional version ¯\\\_(ツ)\_/¯. 109 | Here's what you do when releasing a hotfix: 110 | 111 | 1. Merge the corresponding pull request in the extractor. 112 | 2. [Publish the new extractor version](#extractor-releases). 113 | 3. Update the extractor version in the app's `build.gradle` file. 114 | 4. Create a new release draft and put some info on the fix into the [release note](#release-notes). 115 | 5. Copy the release notes into the fastlane directory to create a [changelog file](#changelog-file). 116 | 6. Increment the __small minor__ version number and the `versionCode`. 117 | 7. Generate a release APK (`gradlew assembleRelease`) and sign it (or get it signed by one of the other maintainers). 118 | 8. Add the signed APK to the GitHub release notes. 119 | 9. Click "Publish Release" . 120 | 10. [Publish the new version on F-Droid](#publish-on-f-droid). 121 | 11. Merge the changes from __master__ into __dev__. 122 | 12. [Update the changelog for the website](https://github.com/TeamNewPipe/website/blob/master/_includes/release_data.html). 123 | 124 | ![rebase_back_hotfix](img/rebase_back_hotfix.svg) 125 | 126 | ## Extractor releases 127 | In general, the release process for extractor versions is not that complicated compared to app releases. 128 | The extractor has (in difference to the app) a decent test coverage. 129 | Additionally, the latest extractor version is typically tested in the app's latest __dev__ version. 130 | Therefore, a long test phase is not needed when creating extractor releases. 131 | 132 | To create a new [extractor version](#version-nomenclature-of-the-extractor), update the __version__ in the extractor's `build.gradle` file 133 | as well as the version names in the README. 134 | Merge the __dev__ branch into __master__. 135 | The same that applies the app's [release notes](#release-notes) also applies to the extractor's release notes. 136 | 137 | When publishing an extractor release via GitHub on the __master__ branch, 138 | a new [JavaDoc version](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/) 139 | is generated and published automatically. 140 | Pleas keep an eye on the GitHub Action which is responsible for that. 141 | If changes in that release introduced invalid JavaDoc, the build fails and needs to be fixed. 142 | For this reason, you should check locally if there are any problems with the JavaDoc generation before publishing the new version. 143 | 144 | 145 | ## Version Nomenclature 146 | 147 | The version nomenclature of NewPipe is simple. 148 | 149 | - __Major__: The __major__ version number (the number before the first dot) was 0 for years. 150 | The reason for this changed over time. First, I wanted this number to 151 | switch to 1 once NewPipe was feature complete. 152 | Now, I rather think of incrementing this number to 1 once we can ensure that NewPipe runs stable 153 | (part of which this documentation should help). 154 | After this, well, God knows what happens if we ever reach 1. ¯\\\_(ツ)\_/¯ 155 | - __Minor__: The __minor__ version number (the number after the first dot) 156 | will be incremented if there is a major feature added to the app. 157 | - __Small Minor__: The small minor (the number after the second dot) 158 | is incremented when bug fixes or minor features are added to the app. 159 | 160 | 161 | #### Version Nomenclature of the Extractor 162 | 163 | Previously, the extractor was released together with the app, 164 | therefore the version number of the extractor was identical to the one of NewPipe itself. 165 | 166 | We try to combine efforts to make NewPipe Extractor more independent of the app. 167 | The extractor is used by multiple other applications 168 | and therefore releasing extractor updates should not be coupled to app releases. 169 | However, maintainers need to keep an eye on making the app compatible with extractor changes. 170 | 171 | ## Release Notes 172 | Release notes should tell what was changed in the new version of the app. 173 | The release notes for NewPipe are stored in the 174 | [GitHub draft for a new release](https://github.com/TeamNewPipe/NewPipe/releases). 175 | When a maintainer wants to add changes to the release notes, 176 | but there is no draft for a new version, they should create one. 177 | 178 | Changes can be categorized into five basic types: 179 | 180 | - __New__: New features that got added to the app. 181 | - __Improved__: Improvements to the app or existing features 182 | - __Fixed__: Bugfixes 183 | - __Translation__: New translations 184 | - __Development__: Changes which address things "under the hood", 185 | which do not have any recognizable effect to the user; e.g. dependency updates or changes to the build process 186 | 187 | When adding a PR to the release notes, increase the PR counter at the top of the draft 188 | and put the number before the PR summary / title. 189 | This helps the blog post authors to keep easily track of new PRs. 190 | Remove the numbers before publishing a new version :) 191 | 192 | If there is a blog post covering the changes in more detail, 193 | make sure to link it on the top of the release notes. 194 | It would be a pity, if only a few people read the blog post 195 | after our wonderful writers put so much effort into creating it. 196 | 197 | ### Changelog file 198 | 199 | Maintainers need to provide a changelog file for each release. 200 | A changelog file is used by F-Droid to give a quick summary of the most important changes for a release. 201 | This file is placed in the 202 | [`/fastlane/metadata/android/en-US/changelogs`](https://github.com/teamnewpipe/newpipe/tree/dev/fastlane/metadata/android/en-US/changelogs) 203 | directory and named `.txt` (whereas `` is the version code of the incoming release). 204 | Changelog files *must not* exceed 500 bytes. 205 | Be aware that the changelog is translated into multiple languages. 206 | A changelog written in English which almost hits 500 bytes can hardly be translated completely within this limit. 207 | This causes troubles for translators, because Weblate enforces the 500 bytes limit, too. 208 | For this reason it is recommended to keep the changelog at 400 bytes. 209 | 210 | When creating the changelog file be aware of changes which were done in the extractor as well. 211 | Before pushing the changelog to NewPipe's repo, ask other maintainers to review it. 212 | After pushing the changelog to NewPipe's GitHub repo, [updating Weblate](../09_maintainers_view#update-weblate) is necessary. 213 | This enables translators to work on localized versions of the changelog before a release is tagged and published. 214 | 215 | ## Publish on F-Droid 216 | 217 | NewPipe is and supports open source software. 218 | For this reason, the preferred way to distribute the app is [F-Droid](https://f-droid.org). 219 | F-Droid is a catalogue of FOSS apps and also comes with an Android client which handles app updates. 220 | There are two ways to install NewPipe via F-Droid. 221 | 222 | 1. **Through the main F-Droid repository** 223 | NewPipe's metadata file can be found in F-Droid's data repository on GitLab: 224 | [https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/org.schabi.newpipe.yml](https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/org.schabi.newpipe.yml) 225 | This file is automatically updated by a bot when a new release is published on GitHub. 226 | It can take a few days until all new apps on F-Droid are built, signed and published. 227 | [F-Droid also supports reproducible builds](https://f-droid.org/docs/Reproducible_Builds/). 228 | Reproducible builds or deterministic builds allow someone else to retrieve the exact same binary 229 | as we get when building the app (except the signing of course). 230 | When the reproducible build feature is enabled for an app in F-Droid, they compare their binary to one provided by the author. 231 | If both are identical, F-Droid does not only publish the binary signed by themselves, but also the one signed by the author. 232 | Currently, NewPipe's builds are not deterministic, and we therefore cannot use that feature. 233 | Once the builds are deterministic again, the following steps need to be done to publish a new version on F-Droid: 234 | 1. [Install `fdroidserver` on your device](https://f-droid.org/docs/Installing_the_Server_and_Repo_Tools/). 235 | * Clone the F-Droid Data repo from `https://gitlab.com/fdroid/fdroiddata` 236 | * Add the new version to `metadata/org.schabi.newpipe.yml` 237 | * Run `fdroid signatures /path/to/newpipe.apk` on the signed APK from within the repo. 238 | * Create a MR on GitLab. 239 | An example commit containing all required changes can be found [here](https://gitlab.com/fdroid/fdroiddata/-/commit/393bbb756d5bed4134eb147f411a9d9aa1d47386). 240 | 3. **Through NewPipe's F-Droid repository** 241 | F-Droid needs 242 | NewPipe's own F-Droid repo is available at [https://archive.newpipe.net/fdroid/repo](https://archive.newpipe.net/fdroid/repo/?fingerprint=E2402C78F9B97C6C89E97DB914A2751FDA1D02FE2039CC0897A462BDB57E7501) 243 | It is updated and maintained by [@TheAssassin](https://github.com/TheAssassin). 244 | -------------------------------------------------------------------------------- /docs/07_release_instructions.md: -------------------------------------------------------------------------------- 1 | # Release instructions for normal releases 2 | 3 | This page contains detailed instructions for normal releases. Refer to [Releasing a New NewPipe Version](../06_releasing) for other information about releases. 4 | 5 | ## Preliminary steps 6 | 7 | ### Permissions 8 | 9 | - Have admin rights on Weblate 10 | - You should be able to access [Weblate's Maintenance page](https://hosted.weblate.org/projects/newpipe/#repository) 11 | - Tip: if the correct page does not show up when clicking that URL, make sure you are logged in ;-) 12 | - Have at least maintainer rights on the NewPipe and NewPipeExtractor repos 13 | 14 | ### Repositories 15 | 16 | - Have a cloned NewPipe local repository (for the rest of the page, `origin` is assumed to be the remote at `github.com/TeamNewPipe/NewPipe`) 17 | - Add the `weblate` remote to the same local repository (the URL used below can be found on the Maintenance page on Weblate) 18 | - `git remote add weblate https://hosted.weblate.org/git/newpipe/strings/` 19 | - Make sure there are no pending changes 20 | - `git clean -fdx` to **discard** them all (**CAUTION**) 21 | - Switch to the `dev` branch and make sure it is up-to-date with the remote: 22 | - `git checkout dev` 23 | - `git pull origin dev` 24 | 25 | ### Version name and conventions 26 | 27 | - Find the version code of the next release by looking for `versionCode` in [`app/build.gradle`](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle): You will add 1 to that value (from now on called `NEW_VERSION_CODE`) to get the new value (but do not edit the file yet) 28 | - Choose the version number of the next release according to [semantic versioning](https://semver.org/) (from now on called `X.X.X`) 29 | 30 | ### Identification 31 | 32 | - Have `gpg` installed and usable on your PC 33 | - Have a GPG key, which can be used to verify that a file is really from you 34 | 35 | ## Pull changes from Weblate 36 | 37 | - Go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository) 38 | - Press the *Lock* button to prevent translators from translating while you are creating commits; remember to *Unlock* later! 39 | - Press the *Update* button to update Weblate with the latest changes on NewPipe's `dev` branch 40 | - Press the *Commit* button, if needed, to make sure Weblate creates a commit for translations which have not been committed yet 41 | - Now go back to the local git repository 42 | - In case you followed these steps before, delete the `weblate-dev` branch 43 | - `git branch -D weblate-dev` 44 | - Fetch new changes from the `weblate` remote 45 | - `git fetch weblate` 46 | - Create a new branch starting from `weblate/dev`, named `weblate-dev`, and switch to it 47 | - `git checkout -b weblate-dev weblate/dev` 48 | - If you run `git log --oneline --graph` you should see a Weblate commit on top, and then all of the commits currently on the `dev` branch: 49 | ```md 50 | * cmt12hash (HEAD -> weblate-dev, weblate/dev) Translated using Weblate (...) 51 | * cmt89hash (origin/dev, dev) Commit message ... 52 | ``` 53 | - Switch back to the `dev` branch 54 | - `git checkout dev` 55 | - Merge `weblate-dev` into `dev`: 56 | - `git merge weblate-dev` 57 | 58 | ## Create a changelog 59 | 60 | - Finalize the draft changelog [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases), in case there are still some things to fill in 61 | - Remove the temporary instructions, and the numbers before `-` which keep track of the order in which the PRs were merged, as that info is useful only for the blog post writers 62 | - Before removing that information, you may want to send the original changelog to the blogpost writers 63 | - Create a new English changelog in the [`fastlane/metadata/android/en-US/changelogs/`](https://github.com/TeamNewPipe/NewPipe/blob/dev/fastlane/metadata/android/en-US/changelogs/) folder 64 | - The file should be named `NEW_VERSION_CODE.txt`, using the new version code found in the [Preliminary steps](#preliminary-steps) 65 | - The file should have this structure (sections with no points can be removed): 66 | ```txt 67 | New 68 | • ... 69 | 70 | Improved 71 | • ... 72 | 73 | Fixed 74 | • ... 75 | ``` 76 | - Make sure you use the `•` for points (it looks nicer than `-`) 77 | - Capitalize the first letter in each point 78 | - Use English verbs as if you were asking someone to do something, so for example use "Fix abc" and not "Fixed abc"; this allows saving a few characters and using a consistent style 79 | - Prepend `[SERVICE]` to service-only changes (e.g. "• \[YouTube\] Add mixes") 80 | - Summarize only the most important changes from the draft release [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases) (it contains all merged pull requests) 81 | - Make sure the file size is **at most 500 bytes**, in order to **fit [F-Droid's changelog size limit](https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/#fastlane-structure) (!)** 82 | - Tip: removing the newline at the end of the file saves 1 byte ;-) 83 | - Commit the file on the `dev` branch (try to stick to the provided commit message template) 84 | - `git add fastlane/metadata/android/en-US/changelogs/NEW_VERSION_CODE.txt` 85 | - `git commit -m "Add changelog for vX.X.X (NEW_VERSION_CODE)"` 86 | 87 | ## Push the changelog to Weblate 88 | 89 | Now there should be two new commits (the Weblate and changelog ones) on your local `dev` branch, which are not on NewPipe's remote `dev` branch. 90 | 91 | - If you are an admin of the NewPipe repo, just push the changes to the remote `dev` 92 | - `git push origin dev` 93 | - If you are not an admin, create a pull request normally and ask someone with maintainer access to merge it 94 | - Go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository) 95 | - Press the *Update* button to update Weblate with the commit you just pushed on NewPipe's `dev` branch 96 | - **Press the *Unlock*** button to allow translators to translate the changelog and possibly other components (**do not forget this step!**) 97 | - Note that we had to do this process on NewPipe's `dev` branch because: 98 | - Weblate's components are connected to NewPipe's `dev` branch, and will update changes from there 99 | - Weblate's git repo is not writable, so there is no way to push commits there manually 100 | 101 | ## Creating the release branch 102 | 103 | - Create a new branch starting from `dev`, named `release-X.X.X`, and switch to it 104 | - `git checkout dev` 105 | - `git checkout -b release-X.X.X` 106 | - Edit the [`app/build.gradle`](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle) file to update the extractor 107 | - Set the NewPipeExtractor dependency version to a suitable one (usually [the last commit in the NewPipeExtractor repo](https://github.com/TeamNewPipe/NewPipeExtractor/commits/dev)) 108 | - Commit the extractor update (if you used a specific version, append `to VERSION` to the commit message) 109 | - `git add app/build.gradle` 110 | - `git commit -m "Update NewPipeExtractor"` 111 | - Edit the [`app/build.gradle`](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle) file to bump the release 112 | - Set `versionCode` to `NEW_VERSION_CODE`, i.e. increment the value by 1 as described in the [Preliminary steps](#preliminary-steps) 113 | - Set `versionName` to `"X.X.X"` 114 | - Commit the version bump (try to stick to the provided commit message template) 115 | - `git add app/build.gradle` 116 | - `git commit -m "Release vX.X.X (NEW_VERSION_CODE)"` 117 | - Push the newly created branch to the NewPipe repo 118 | - `git push origin release-X.X.X` 119 | 120 | ## Creating the Pull Request 121 | 122 | - Create a Pull Request (PR) from the new branch you just pushed 123 | - If you used the correct branch name you should be able to use this URL, after changing the X.X.X: `https://github.com/TeamNewPipe/NewPipe/pull/new/release-X.X.X` 124 | - Make sure the PR has `master` as the *base* branch and `release-X.X.X` as the *compare* branch 125 | - The PR title should be "Release vX.X.X (NEW_VERSION_CODE)" 126 | - Remove the entire PR template, and instead put these two lines in the description (the `ISSUE_NUMBER` will be replaced later): 127 | ```md 128 | Do **not** report regressions here, but rather in the corresponding issue: #ISSUE_NUMBER 129 | The changelog is also there. 130 | ``` 131 | - Once you have created the PR, note down its number (from now on called `PR_NUMBER`) 132 | - In case some issue would be fixed when the release PR is merged, link them using the "Development" tab on the right, or add a "Fixes #...." in the PR description 133 | - *Check out [#8231](https://github.com/TeamNewPipe/NewPipe/pull/8231) for reference* 134 | 135 | ## Creating the issue 136 | 137 | - Create an issue 138 | - Click [here](https://github.com/TeamNewPipe/NewPipe/issues/new) to open one without a template 139 | - The issue title should be "Release vX.X.X (please TEST!)" 140 | - The issue should have some sections, in the same order as provided below, with `##` before titles 141 | - The `## Testing for regressions` section should contain the following lines; more information about how to obtain the APK are given at [Testing APKs](#testing-apks) 142 | ```md 143 | Debug APK (built by our CI in #PR_NUMBER): ... 144 | Please report **only regressions** (i.e. new issues) here, not issues that were already present in previous releases! 145 | ``` 146 | - An optional `## TODO` section should contain a list of things that still need to be done before releasing, for example regressions that need to be fixed, or a reminder to merge the Weblate changelogs before releasing (use `- [ ]` to create checkbox lists) 147 | - The `## NewPipeExtractor version` section should contain a link to the NewPipeExtractor release this new NewPipe version will ship with (i.e. the one set in [Creating the release branch](#creating-the-release-branch)); choose one of these lines as a template 148 | ```md 149 | This version of NewPipe will ship with [NewPipeExtractor version NPE_VERSION](https://github.com/TeamNewPipe/NewPipeExtractor/releases/tag/NPE_VERSION) 150 | This version of NewPipe will ship with [NewPipeExtractor commit FIRST_7_DIGITS_OF_NPE_COMMIT](https://github.com/TeamNewPipe/NewPipeExtractor/commit/NPE_COMMIT) 151 | ``` 152 | - Create the `App changelog` section using the template below. Copy the draft Markdown changelog [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases) (you finalized it earlier in [Create a changelog](#create-a-changelog)) to the clipboard and paste it where specified below (make sure to leave a newline above, otherwise Markdown breaks): 153 | ```md 154 |

App changelog

155 | 156 | INSERT_COPIED_CHANGELOG_HERE 157 |

158 | ``` 159 | - Once you have created the issue, pin it using the "Pin issue" button on the right 160 | - Update the `ISSUE_NUMBER` in the pull request description 161 | - *Check out [#8230](https://github.com/TeamNewPipe/NewPipe/issues/8230) for reference* 162 | 163 | ## Testing APKs 164 | 165 | The first time you open the release issue, and then each time some changes are made to the release PR, you should provide a debug APK in the `## Testing for regressions` section. 166 | 167 | - Wait for the Continuous Integration (CI) to finish testing the PR, then download the resulting debug APK artifact from the "Checks" tab 168 | - Rename it to `NewPipe_vX.X.X_RC1_debug.apk` where `RC1` should be incremented to `RC2` and so on each time a new APK is provided 169 | - Zip it and make sure the `.zip` file has the same name as the `.apk` it contains 170 | - Upload it in the issue description, replacing the `...` placeholder used above 171 | 172 | Sometimes it might be needed to also provide a release APK. In this case follow the same steps as above, with these differences: 173 | 174 | - Make sure you are on the `release-X.X.X` branch 175 | - Build the **release** APK yourself in Android Studio and sign it with your keys 176 | - *Temporarily* edit the `app/build.gradle` file and add `System.properties.put("packageSuffix", "vX_X_X")` at the top of the `android -> buildTypes -> release` block, which ensures that the application has a different package name than the official one 177 | - Build and sign an APK via "Build -> Generate Signed Bundle / APK..." 178 | - Make sure it installs correctly on your device 179 | - Use this naming scheme: `NewPipe_vX.X.X_RC1_release.apk` 180 | - Add a line to the `## Testing for regressions` section, of this form: `Release APK (built and signed by @YOUR_GITHUB_USERNAME): ...` 181 | 182 | ## Taking care of regressions (quickfixes) 183 | 184 | The release issue and pull request should stay open for **roughly one week**, so that people can test the provided APKs and give feedback. If a *regression* is reported by some user, it should possibly be solved before releasing, otherwise the app would become more broken after each release. A *regression* is a bug now present in some code that used to run well in the last release, but was then modified in this release (supposedly to fix something else) and is now broken. So the following do not classify as regressions: some videos stop working because YouTube made some changes; the newly introduced big feature XYZ is still not perfect and has some bugs; a random crash reproducible also on previous versions... You get the point. Before releasing, try to fix any regressions that are reported, but avoid fixing non-regressions, since those should be treated with the same care and attention as all other issues. As a Release Manager, you might be required to fix regressions, so plan your release at a time when you are available. 185 | 186 | Pull requests fixing regressions should target the `release-X.X.X` branch, not the `dev` branch! When merging those PRs, also provide a new Release Candidate APK. 187 | 188 | ## Finally merging the pull request 189 | 190 | Once enough time has passed and all regressions and TODOs have been solved, you can proceed with the actual release. The following points include merging weblate changes again. 191 | 192 | - In the local repository, check out the release branch and make sure it is up-to-date with the remote 193 | - `git checkout release-X.X.X` 194 | - `git pull origin release-X.X.X` 195 | - Go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository) 196 | - Press *Lock*; remember to *Unlock* later! 197 | - Press *Update* 198 | - Press *Commit*, if needed 199 | - Now go back to the local git repository 200 | - Delete the `weblate-dev` branch, just in case 201 | - `git branch -D weblate-dev` 202 | - Fetch changes from Weblate (in particular you should see the `weblate/dev` remote branch being updated) 203 | - `git fetch weblate` 204 | - Obtain the hash of the last commit on the `weblate/dev` remote branch 205 | - `git log -n 1 --pretty="format:%H" weblate/dev` 206 | - Cherry pick the hash you obtained above into the release branch (the one you are currently on) 207 | - `git cherry-pick HASH` 208 | - Push the changes to the remote branch 209 | - `git push origin release-X.X.X` 210 | - Merge the PR you created before 211 | - Delete the GitHub remote branch associated with the PR, i.e. `release-X.X.X` (there should be a button in the PR) 212 | - Close the issue you created before 213 | - Merge `dev` back into `master` (since the PR merged changes onto `master`) 214 | - `git checkout master` 215 | - `git pull origin master` 216 | - `git checkout dev` 217 | - `git pull origin dev` 218 | - `git merge master` 219 | - `git push origin dev` or create another temporary PR and merge it immediately 220 | - Go to [Weblate's Maintenance tab](https://hosted.weblate.org/projects/newpipe/#repository) 221 | - **Press *Unlock*** 222 | 223 | ## Creating the APK 224 | 225 | Now on the remote `master` branch there is the release code which you need to turn into an APK. The APK needs to be built with **JDK 21**, [as agreed with the F-Droid team](https://github.com/TeamNewPipe/NewPipe/issues/11754), to ensure reproducibility. 226 | 227 | You should build the APK using the `build-release-apk` CI workflow: 228 | 229 | - Go to the [workflow's page](https://github.com/TeamNewPipe/NewPipe/actions/workflows/build-release-apk.yml) 230 | - The page will say "This workflow has a `workflow_dispatch` event trigger.", click on "Run workflow" on the right 231 | - In the "Use workflow from" prompt, don't change anything (i.e. use `dev`); the workflow uses the last commit from the `master` branch in any case! 232 | - Wait for the workflow to finish 233 | - Download `app.zip` from the workflow artifacts, extract the APK from the archive, and make sure it is called `NewPipe_vX.X.X.apk` 234 | 235 | *In alternative*, in case something is wrong with the CI or you don't have permission to run the workflow, follow these steps to build with Android Studio: 236 | 237 | - In the local repository, check out the `master` branch and make sure it is up-to-date with the remote 238 | - `git checkout master` 239 | - `git pull origin master` 240 | - Open the local project in Android Studio 241 | - Go to *Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JDK* and select JDK 21 242 | - Run the Gradle `clean` task using Android Studio's interface, in order to clean up temporary/cache files that may interfere with reproducible builds 243 | - Double press Ctrl, type `gradle clean`, press Enter 244 | - Make sure leftover files from building RC releases are actually removed, in order to avoid confusion 245 | - `rm -rf ./app/release` 246 | - Run the Gradle `assembleRelease` task using Android Studio's interface: it will start the process of building an unsigned APK 247 | - Double press Ctrl, type `gradle assembleRelease`, press Enter 248 | - After a while you should find the APK under `./app/build/outputs/apk/release/app-release-unsigned.apk` 249 | - Rename `app-release-unsigned.apk` to `NewPipe_vX.X.X.apk` 250 | 251 | ## Having the APK signed by @TheAssassin 252 | 253 | Currently @TheAssassin is the only holder of NewPipe's APK signing keys. Therefore you should send the unsigned APK to him, after which he will sign it and send it back to you. He will also then publish the signed APK in NewPipe's F-Droid repo. 254 | 255 | - Make sure the APK is called `NewPipe_vX.X.X.apk` 256 | - Generate a signature for the APK file 257 | - `gpg -b NewPipe_vX.X.X.apk` will generate `NewPipe_vX.X.X.apk.sig` 258 | - It will also output 'using "FINGERPRINT" as default secret key for signing'; keep track of the `FINGERPRINT` part 259 | - Send an email to @TheAssassin and attach both `NewPipe_vX.X.X.apk` and `NewPipe_vX.X.X.apk.sig` 260 | - If @TheAssassin does not already know it, send him your PGP key `FINGERPRINT` you obtained before 261 | - You should not send it using email this time, but using another service through which @TheAssassin can be almost sure it is really you (this is a sort of 2FA) 262 | - For example, you can send it on the IRC group, or create a GitHub gist with the fingerprint and then give that link to @TheAssassin 263 | - Notify him on IRC that you have sent him an email 264 | - He will send you back the signed APK 265 | - Make sure its name is still `NewPipe_vX.X.X.apk` (rename if it's not the case) 266 | - Install it on your device to see if everything went well (note that installation will work only if your currently installed version of newpipe comes from NewPipe's F-Droid repo or GitHub) 267 | - **Tell @TheAssassin to "push the buttons"**, i.e. publish the signed APK in NewPipe's F-Droid repo. 268 | 269 | ## Publishing the release 270 | 271 | - Go to the draft changelog [kept on GitHub](https://github.com/TeamNewPipe/NewPipe/releases) 272 | - Set `vX.X.X` as the tag name 273 | - Set `vX.X.X` as the release title 274 | - Set `master` as the "Target:" branch 275 | - Attach the signed APK @TheAssassin sent you 276 | - Publish the release 277 | - Profit :-D 278 | 279 | ## Updating the official F-Droid repository 280 | 281 | - You should open a Merge Request similar to [this one](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15367) on the [fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository 282 | - Follow [these instructions](https://f-droid.org/en/docs/Reproducible_Builds/#publish-both-upstream-developer-signed-and-f-droid-signed-apks) to extract signatures from the APK 283 | - This step is not mandatory, as the F-Droid team will take care when they notice the new release, but it is better if we do not burden them with more work 284 | 285 | ## Blog post 286 | 287 | The blog post writers need an up-to-date list of merged PRs numbered in chronological order. This is so that they can keep track of what changes have already been detailed in the draft blog post, and which ones still need to be added. So make sure that there is always at least one up-to-date "master copy" of the draft release notes available for them to review. 288 | 289 | The blog post should ideally be published before the GitHub release is made (so that the link to it works!), but in case of some delay, it is fine to let the blog post come later. It is far more important to get the release into users' hands sooner. 290 | 291 | - In order for the blog post to be published, ask @TheAssassin to "press the buttons" again 292 | - Once the blog post is ready, add this block of text on top of the release notes on GitHub: 293 | ``` 294 | [:arrow_right: :arrow_right: :arrow_right: Read the blog post :arrow_left: :arrow_left: :arrow_left:](LINK_TO_BLOG_POST) 295 | ``` 296 | -------------------------------------------------------------------------------- /docs/08_documentation.md: -------------------------------------------------------------------------------- 1 | # About This Documentation 2 | 3 | 4 | The documentation you are currently reading was written using [mkdocs](https://www.mkdocs.org/). It is a tool that will generate a static website based on [markdown](https://www.markdownguide.org/) files. Markdown has the advantage that it is simple to read and write, and that there are several tools that can translate a markdown file into languages like HTML or LaTeX. 5 | 6 | ## Installation 7 | 8 | Mkdocs is written in [Python](https://www.python.org/) and is distributed through the Python internal package manager [pip](https://pypi.org/project/pip/), thus you need to get python and pip running on your operating system first. 9 | 10 | ## Windows 11 | 12 | 1. Download the latest [Python3](https://www.python.org/downloads/windows/) version. 13 | 2. When running the setup program, make sure to tick, "Add Python 3.x to PATH". 14 | ![check_path](img/check_path.png) 15 | 3. Install Python. 16 | 4. Open PowerShell or cmd.exe and type: `pip3 install mkdocs`. 17 | 18 | ## MacOS 19 | 20 | MacOS already includes Python, however, pip is still missing. The easiest and most nondestructive way is to install the MacOS package manager, [homebrew](https://brew.sh/index_de), first. The advantage of homebrew is that it will only modify your home directory, and not the root dir, so your OS will not be tampered with. 21 | 22 | 1. Install [homebrew](https://brew.sh/index_de). 23 | 2. Install Python from Homebrew, which will also install pip. Enter this command: 24 | `brew install python`. 25 | 3. Install mkdocs: 26 | `pip3 install mkdocs`. 27 | 28 | ## Linux/*BSD 29 | 30 | Linux/*BSD also has Python pre-installed. Most distributions also contain pip by default. If it is not installed, you may need to figure out how to install pip3 through the package manager of your system. 31 | 32 | 1. Install pip3 with these commands according to distributions: 33 | - __Ubuntu/Mint__: `apt install python3-pip` 34 | - __Fedora/CentOS__: `sudo dnf install python3-pip` 35 | - __Arch/Manjaro__: `sudo pacman -S python-pip` 36 | - __openSuse__: `sudo zypper install python-pip` 37 | - __*BSD__: You are already advanced enough to know how you can force the bits on your disk to become pip by meditating upon it. 38 | 2. Run `pip3 install mkdocs` to install mkdocs only for the current user, 39 | or run `sudo pip3 install mkdocs` to install mkdocs systemwide. Last one has the higher chance to work properly. 40 | 41 | ## Android/ChromeOS 42 | This might sound funny, but according to the growing amount of Chromebooks and Android tablets with keyboards, this might actually be useful. 43 | 44 | 1. Install the [Termux App](https://termux.com/) from [F-Droid](https://f-droid.org/packages/com.termux/). 45 | 2. Launch Termux and type `apt update` 46 | 3. Install Python and Git with the command: `apt install git python` 47 | 4. Install mkdocs with `pip install mkdocs`. 48 | 49 | From herein, everything will be the same as on Desktop. If you want to edit the files, you can (besides vim or emacs which are available through Termux) use your preferred text editor on Android. This is possible by opening the files with the Termux integration of the build in android file manager: 50 | 51 | ![termux_files](img/termux_files.png) 52 | 53 | ## Updating 54 | Sometimes, mkdocs changes the way of how it serves, or the syntax will differ. This is why you should make sure to always run the latest version of mkdocs. To check, simply run `pip3 install --upgrade mkdocs` or `sudo pip3 install --upgrade mkdocs` if you installed pip system wide on a Linux/BSD* system. 55 | 56 | ## Using mkdocs 57 | In order to extend this documentation, you have to clone it from its [GitHub repository](https://github.com/TeamNewPipe/documentation). When you clone it, you will find a [mkdocs.yml](https://github.com/TeamNewPipe/documentation/blob/master/mkdocs.yml) file, and a [docs](https://github.com/TeamNewPipe/documentation/tree/master/docs) directory inside. The yaml file is the [config file](https://www.mkdocs.org/user-guide/configuration/) while in the directory docs the documentation files are stored. [Here](https://www.mkdocs.org/user-guide/writing-your-docs/) is a guide about how to use mkdocs. 58 | 59 | ## Write and Deploy 60 | If you are writing a documentation page and want a live preview of it, you can enter the root directory of this documentation project, and then run `mkdocs serve` this will start the mkdocs internal web server on port `8000`. So all you have to do is type `localhost:8000` into the address bar of your browser, and here you go. If you modify a file, and save it, mkdocs will reload the page and show you the new content. 61 | 62 | If you want to deploy the page so it will be up to date at the [GitHub pages](https://teamnewpipe.github.io/documentation/), simply type `mkdocs gh-deploy`. However, please be aware that this will not push your changes to the `master` branch of the repository. So, you still have to commit and push your changes to the actual git repository of this documentation. _Please be aware that only privileged maintainers can do this._ 63 | -------------------------------------------------------------------------------- /docs/09_maintainers_view.md: -------------------------------------------------------------------------------- 1 | # Maintainers' Section 2 | 3 | These are some basic principles that we want maintainers to follow when maintaining NewPipe. 4 | 5 | 6 | ### Keep it Streamlined 7 | NewPipe is a media player for devices on the Android platform, thus it is intended to be used for entertainment. This means it does not have to be some professional 8 | application, and it does not have to be complicated to be used. 9 | However NewPipe might not focus on the casual user completely as there are 10 | some features designed for more experienced users which may require some knowledge about 11 | code, however in essence NewPipe should be easy to use, even for an average Android user. 12 | 13 | 1. __Don't add too many special 14 | features.__ NewPipe does not have to be an airplane cockpit. Do not try to fill every single niche that might exist. If people wanted more advanced features, they 15 | would use professional tools. If you add too much functionality, you add complexity, and complexity scares away the average user. Focus on NewPipe's scope as a **media player** for the end user, and only as such. 16 | 2. __Usability of the user interface should be prioritized.__ Try to make it comply with 17 | [material design guidelines](https://material.io/design/guidelines-overview/). 18 | 19 | 20 | ### Bugfixes 21 | 22 | ![kde_in_a_nutshell](img/kde_in_a_nutshell.jpg)] 23 | 24 | *Disclaimer: This is a meme. Please don't take it personally.* 25 | 26 | __Always prioritize fixing bugs__, as the best application with the best features 27 | does not help much if it is broken, or annoying to use. Now if a program 28 | is in an early stage it is quite understandable that many things break. This 29 | is one reason why NewPipe still has no "1" in the beginning of its version 30 | number. 31 | By now, NewPipe is in a stage where there should be a strong focus on 32 | stability. 33 | 34 | 1. If there are multiple Pull Requests open, check the ones with bugfixes first. 35 | 2. Do not add too many features every version, as every feature will inevitably 36 | introduce more bugs. It is OK if PRs remain open for a while, but don't leave them open for too long. 37 | 3. If there are bugs that are stale, or open for a while bump them from time 38 | to time, so devs know that there is still something left to fix. 39 | 4. Never merge PRs with known issues. From our perception the community does not like to fix bugs, this is why you as a maintainer should 40 | especially focus on pursuing bugs. 41 | 42 | 43 | ### Features 44 | 45 | Features are also something that can cause a headache. You should not blindly 46 | say yes to features, even if they are small, but you should also not immediately say no. If you are not sure, try the feature, look into the 47 | code, speak with the developer, and then make a decision. When considering a feature, ask yourself the following questions: 48 | 49 | - Was the feature requested by only a few, or by many? 50 | - Avoid introducing niche features to satisfy a small handful of users. 51 | - Was the code rushed and messy, and could a cleaner solution be made? 52 | - A pull request that adds a frequently requested feature could implement the feature in a messy way. Such PRs should not be merged as it will likely cause problems later down the line, either through problems of extending the feature by introducing many bugs, or simply by breaking the architecture or the philosophy of NewPipe. 53 | - Does the amount of code justify the feature's purpose? 54 | - Use critical thinking when considering new features and question 55 | whether that features makes sense, is useful, and if it would benefit NewPipe's users. 56 | 57 | 58 | 59 | ### Pull Requests 60 | 61 | If a PR contains more than one feature/bugfix, be cautious. The more stuff a PR changes, the longer it will take to be added. 62 | There also might be things that seem to not have any issues, but other things will, and this would prevent you from merging a PR. This is why it is encouraged to keep one change per pull request, and you should insist that contributors divide such PRs into multiple smaller PRs when possible. 63 | 64 | ### Community 65 | 66 | When you talk to the community, stay friendly and respectful with good etiquette. 67 | When you have a bad day, just don't go to GitHub (advice from our experience ;D ). 68 | 69 | ### Managing translations via Weblate 70 | NewPipe is translated via [Weblate](https://hosted.weblate.org/projects/newpipe). 71 | There are two different components which are open for translation: 72 | 73 | - The app [`strings`](https://hosted.weblate.org/projects/newpipe/strings/). 74 | - The fastlane [metadata](https://hosted.weblate.org/projects/newpipe/metadata/); 75 | this includes the F-Droid store description and changelogs. 76 | 77 | Maintainers can access more options to handle Weblate via the 78 | [Manage > Repository Maintenance](https://hosted.weblate.org/projects/newpipe/#repository) button 79 | or via the [Weblate CLI](https://docs.weblate.org/en/latest/wlc.html#wlc). These options include 80 | basic access to Git operations like commit and rebase 81 | as well as locking Weblate to prevent further changes to translations. 82 | 83 | [![Weblate Web Interface](img/weblate.png)](https://hosted.weblate.org/projects/newpipe/#repository) 84 | `HINT: When updating Weblate via the web interface, please use the "Update > Rebase" option.` 85 | 86 | #### Update Weblate 87 | 88 | Weblate is based on NewPipe's `dev` branch and is configured to automatically update its repository to be in sync with NewPipe. 89 | However, Weblate does not update its branch often, therefore it is better to update it manually after changing strings in NewPipe. 90 | 91 | To do thus manually, commit the Weblate changes and rebase the repository. 92 | Sometimes conflicts need to be resoled while rebasing the repository. 93 | Conflicts need to be addressed ASAP, because Weblate is automatically locked once conflicts occur. 94 | To do so, [merge the changes from Weblate into NewPipe](#merge-changes-from-weblate-into-newpipe). 95 | If Weblate does not recognize the new commit by itself, ask Weblate to rebase once more. 96 | Weblate unlocks the translations when all conflicts are resolved and no errors are detected. 97 | 98 | #### Merge changes from Weblate into NewPipe 99 | Weblate does not push the translation changes to NewPipe automatically. 100 | Doing this manually, allows the maintainers to do a quick review of the changes. 101 | 102 | Before merging weblate changes into NewPipe, make sure to commit all Weblate changes and 103 | lock the Weblate to prevent modifications while you update Weblate. 104 | To merge the changes into NewPipe, checkout Weblate's `dev` branch. 105 | You have read access to Weblate's repository via `https://hosted.weblate.org/git/newpipe/strings/`. 106 | If there are conflicts when rebasing weblate, resolve them. 107 | 108 | Check the following things: 109 | - Is there a translation for a new language? If yes, [register the language with the app's langauge selector](https://github.com/TeamNewPipe/NewPipe/pull/5721) 110 | - Use `Analyse > Inspect Code` in Android Studio to find unused strings and potential bugs introduced by Weblate. 111 | Pay attention to plurals in Asian languages. They are broken by Weblate on a regular basis. 112 | 113 | Push the changes to NewPipe's `dev` branch, [update Weblate](#update-weblate) and unlock it. 114 | -------------------------------------------------------------------------------- /docs/img/InfoItemsCollector_objectdiagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | :InfoItemsCollector 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | itemExtractor1:InfoItemExtractor 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | itemExtractor2:InfoItemExtractor 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | itemExtractor3:InfoItemExtractor 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /docs/img/check_path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/check_path.png -------------------------------------------------------------------------------- /docs/img/could_not_decrypt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/could_not_decrypt.png -------------------------------------------------------------------------------- /docs/img/draft_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/draft_name.png -------------------------------------------------------------------------------- /docs/img/feature_branch.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 52 | 55 | 61 | dev 65 | 66 | 72 | 74 | 81 | 85 | 86 | 92 | 96 | 97 | 103 | feature_xyz 107 | 108 | 114 | 116 | 121 | 125 | 126 | 132 | 136 | 137 | 143 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/img/hotfix_branch.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 52 | 55 | 61 | master 65 | 66 | 72 | 74 | 81 | 85 | 86 | 92 | 96 | 97 | 103 | hotfix 107 | 108 | 114 | 116 | 121 | 125 | 126 | 132 | 136 | 137 | 143 | 147 | 148 | 154 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /docs/img/jitpack_fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/jitpack_fail.png -------------------------------------------------------------------------------- /docs/img/kde_in_a_nutshell.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/kde_in_a_nutshell.jpg -------------------------------------------------------------------------------- /docs/img/merge_into_dev.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 52 | 55 | 61 | dev 65 | 66 | 72 | 74 | 81 | 85 | 86 | 92 | 96 | 97 | 103 | feature_xyz 107 | 108 | 114 | 116 | 121 | 125 | 126 | 132 | 134 | 139 | 143 | 144 | 146 | 153 | 157 | 158 | 160 | 167 | 171 | 172 | 178 | PULL REQUEST 182 | Do QA/Codereview here 186 | 187 | 193 | 197 | 198 | 204 | 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /docs/img/onedoes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/onedoes.jpg -------------------------------------------------------------------------------- /docs/img/prepare_tests_passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/prepare_tests_passed.png -------------------------------------------------------------------------------- /docs/img/rebase_back_hotfix.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 52 | 55 | 61 | dev 65 | 66 | 72 | 74 | 81 | 85 | 86 | 92 | 96 | 97 | 103 | 105 | 110 | 114 | 115 | 121 | 125 | 126 | 132 | 136 | 137 | 143 | 149 | hotfix 153 | 154 | 160 | master 164 | 165 | 167 | 174 | 178 | 179 | 185 | 187 | 192 | 196 | 197 | 199 | 206 | 210 | 211 | 217 | 219 | 226 | 230 | 231 | 237 | 241 | 242 | 248 | 250 | 257 | 261 | 262 | 264 | 271 | 275 | 276 | 282 | REBASE 286 | 287 | 293 | 297 | 298 | 304 | 308 | 309 | 310 | 311 | -------------------------------------------------------------------------------- /docs/img/rebase_back_release.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 52 | 55 | 61 | dev 65 | 66 | 72 | 74 | 81 | 85 | 86 | 92 | 96 | 97 | 103 | 105 | 110 | 114 | 115 | 121 | 125 | 126 | 132 | 136 | 137 | 143 | 149 | release_x.y.z 153 | 154 | 160 | master 164 | 165 | 167 | 174 | 178 | 179 | 185 | 187 | 192 | 196 | 197 | 199 | 206 | 210 | 211 | 217 | quickfix 221 | 222 | 228 | 230 | 237 | 241 | 242 | 248 | 252 | 253 | 255 | 262 | 266 | 267 | 273 | 275 | 282 | 286 | 287 | 289 | 296 | 300 | 301 | 303 | 310 | 314 | 315 | 321 | REBASE 325 | 326 | 332 | 336 | 337 | 338 | 339 | -------------------------------------------------------------------------------- /docs/img/release_branch.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 52 | 55 | 61 | dev 65 | 66 | 72 | 74 | 81 | 85 | 86 | 92 | 96 | 97 | 103 | 105 | 110 | 114 | 115 | 121 | 125 | 126 | 132 | 136 | 137 | 143 | 149 | release_x.y.z 153 | 154 | 160 | master 164 | 165 | 167 | 174 | 178 | 179 | 185 | 187 | 192 | 196 | 197 | 199 | 206 | 210 | 211 | 213 | 220 | 224 | 225 | 231 | quickfix 235 | 236 | 242 | PR from release_x.y.z 246 | to master 250 | 254 | 255 | 257 | 264 | 268 | 269 | 270 | 271 | -------------------------------------------------------------------------------- /docs/img/select_gradle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/select_gradle.png -------------------------------------------------------------------------------- /docs/img/select_gradle_wrapper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/select_gradle_wrapper.png -------------------------------------------------------------------------------- /docs/img/sync_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/sync_ok.png -------------------------------------------------------------------------------- /docs/img/termux_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/termux_files.png -------------------------------------------------------------------------------- /docs/img/weblate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/img/weblate.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Welcome to the NewPipe Development Docs 2 | 3 | 4 | 5 | This site is/should be a beginner friendly tutorial and documentation for people who want to use or write services for the [NewPipe Extractor](https://github.com/TeamNewPipe/NewPipeExtractor). However, it also contains several notes about how to maintain NewPipe. 6 | It is an addition to our auto generated [Jdoc documentation](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/). 7 | 8 | Please be aware that it is in its early stages, so help and [feedback](https://github.com/TeamNewPipe/documentation/issues) is always appreciated :D 9 | 10 | 11 | ## Introduction 12 | 13 | The NewPipeExtractor is a Java framework for scraping video platform websites in a way that they can be accessed like a normal API. The extractor is the core of the popular YouTube and streaming app [NewPipe](https://newpipe.schabi.org) for Android. It is entirely independent from said platforms and also available for additional platforms as well. 14 | 15 | The beauty behind this framework is that it takes care of the extracting process, error handling etc. so you can focus on what is important: Scraping the website. 16 | It focuses on making it possible for the creator of a scraper for a streaming service to create the best outcome with the least amount of written code. 17 | -------------------------------------------------------------------------------- /docs/media/how_to_jitpack.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/docs/media/how_to_jitpack.mp4 -------------------------------------------------------------------------------- /linkcheck.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import os 5 | import re 6 | import requests 7 | 8 | BASE_URL = "https://teamnewpipe.github.io/documentation" 9 | 10 | RETURN_VALUE = 0 11 | 12 | os.chdir("docs") 13 | for filename in os.listdir(): 14 | #print(filename + ":") 15 | if ".md" in filename: 16 | with open(filename) as file: 17 | filedata = file.read() 18 | for link in re.findall('\[.*\]\(([^\)]*)\)', filedata): 19 | if link.startswith("#"): 20 | checkstring = "# " + link.replace("#", "").replace("-", " ") 21 | if not checkstring in filedata.lower().replace("-", " "): 22 | RETURN_VALUE = 1 23 | print(filename + ": Could not find target for " + link) 24 | else: 25 | if link.startswith("img/"): 26 | link = BASE_URL + "/" + link 27 | if not link.startswith("http"): 28 | RETURN_VALUE = 1 29 | print(filename + ": " + link + " is not filled out or not http") 30 | elif not link.startswith("https"): 31 | RETURN_VALUE = 1 32 | print(filename + ": " + link + " is not https") 33 | else: 34 | res = requests.get(link, timeout=5) 35 | if res.status_code != 200: 36 | RETURN_VALUE = 1 37 | print(filename + ": " + link + " returns " + str(res.status_code)) 38 | 39 | sys.exit(RETURN_VALUE) 40 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: NewPipe Development Documentation 2 | 3 | theme: 4 | name: readthedocs 5 | custom_dir: theme 6 | -------------------------------------------------------------------------------- /theme/css/github.min.css: -------------------------------------------------------------------------------- 1 | .hljs { 2 | display:block; 3 | overflow-x:auto; 4 | padding:1em; 5 | color:#333; 6 | background:#f8f8f8 7 | } 8 | .hljs-comment,.hljs-quote { 9 | color:#998; 10 | font-style:italic 11 | } 12 | .hljs-keyword,.hljs-selector-tag,.hljs-subst { 13 | color:#333; 14 | font-weight:bold 15 | } 16 | .hljs-number,.hljs-literal,.hljs-variable,.hljs-template-variable,.hljs-tag .hljs-attr { 17 | color:#008080 18 | } 19 | .hljs-string,.hljs-doctag { 20 | color:#d14 21 | } 22 | .hljs-title,.hljs-section,.hljs-selector-id { 23 | color:#900; 24 | font-weight:bold 25 | } 26 | .hljs-subst { 27 | font-weight:normal 28 | } 29 | .hljs-type,.hljs-class .hljs-title { 30 | color:#458; 31 | font-weight:bold 32 | } 33 | .hljs-tag,.hljs-name,.hljs-attribute { 34 | color:#000080; 35 | font-weight:normal 36 | } 37 | .hljs-regexp,.hljs-link { 38 | color:#009926 39 | } 40 | .hljs-symbol,.hljs-bullet { 41 | color:#990073 42 | } 43 | .hljs-built_in,.hljs-builtin-name { 44 | color:#0086b3 45 | } 46 | .hljs-meta { 47 | color:#999; 48 | font-weight:bold 49 | } 50 | .hljs-deletion { 51 | background:#fdd 52 | } 53 | .hljs-addition { 54 | background:#dfd 55 | } 56 | .hljs-emphasis { 57 | font-style:italic 58 | } 59 | .hljs-strong { 60 | font-weight:bold 61 | } 62 | 63 | -------------------------------------------------------------------------------- /theme/css/highlight.css: -------------------------------------------------------------------------------- 1 | .codehilite code, .codehilite pre{color:#3F3F3F;background-color:#F7F7F7; 2 | overflow: auto; 3 | box-sizing: border-box; 4 | 5 | padding: 0.01em 16px; 6 | padding-top: 0.01em; 7 | padding-right-value: 16px; 8 | padding-bottom: 0.01em; 9 | padding-left-value: 16px; 10 | padding-left-ltr-source: physical; 11 | padding-left-rtl-source: physical; 12 | padding-right-ltr-source: physical; 13 | padding-right-rtl-source: physical; 14 | 15 | border-radius: 16px !important; 16 | border-top-left-radius: 16px; 17 | border-top-right-radius: 16px; 18 | border-bottom-right-radius: 16px; 19 | border-bottom-left-radius: 16px; 20 | 21 | border: 1px solid #CCC !important; 22 | border-top-width: 1px; 23 | border-right-width-value: 1px; 24 | border-right-width-ltr-source: physical; 25 | border-right-width-rtl-source: physical; 26 | border-bottom-width: 1px; 27 | border-left-width-value: 1px; 28 | border-left-width-ltr-source: physical; 29 | border-left-width-rtl-source: physical; 30 | border-top-style: solid; 31 | border-right-style-value: solid; 32 | border-right-style-ltr-source: physical; 33 | border-right-style-rtl-source: physical; 34 | border-bottom-style: solid; 35 | border-left-style-value: solid; 36 | border-left-style-ltr-source: physical; 37 | border-left-style-rtl-source: physical; 38 | border-top-color: #CCC; 39 | border-right-color-value: #CCC; 40 | border-right-color-ltr-source: physical; 41 | border-right-color-rtl-source: physical; 42 | border-bottom-color: #CCC; 43 | border-left-color-value: #CCC; 44 | border-left-color-ltr-source: physical; 45 | border-left-color-rtl-source: physical; 46 | -moz-border-top-colors: none; 47 | -moz-border-right-colors: none; 48 | -moz-border-bottom-colors: none; 49 | -moz-border-left-colors: none; 50 | border-image-source: none; 51 | border-image-slice: 100% 100% 100% 100%; 52 | border-image-width: 1 1 1 1; 53 | border-image-outset: 0 0 0 0; 54 | border-image-repeat: stretch stretch;} 55 | .codehilite .hll { background-color: #ffffcc } 56 | .codehilite .c { color: #999988; font-style: italic } /* Comment */ 57 | .codehilite .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 58 | .codehilite .k { color: #000000; font-weight: bold } /* Keyword */ 59 | .codehilite .o { color: #000000; font-weight: bold } /* Operator */ 60 | .codehilite .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 61 | .codehilite .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */ 62 | .codehilite .c1 { color: #999988; font-style: italic } /* Comment.Single */ 63 | .codehilite .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 64 | .codehilite .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 65 | .codehilite .ge { color: #000000; font-style: italic } /* Generic.Emph */ 66 | .codehilite .gr { color: #aa0000 } /* Generic.Error */ 67 | .codehilite .gh { color: #999999 } /* Generic.Heading */ 68 | .codehilite .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 69 | .codehilite .go { color: #888888 } /* Generic.Output */ 70 | .codehilite .gp { color: #555555 } /* Generic.Prompt */ 71 | .codehilite .gs { font-weight: bold } /* Generic.Strong */ 72 | .codehilite .gu { color: #aaaaaa } /* Generic.Subheading */ 73 | .codehilite .gt { color: #aa0000 } /* Generic.Traceback */ 74 | .codehilite .kc { color: #000000; font-weight: bold } /* Keyword.Constant */ 75 | .codehilite .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ 76 | .codehilite .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */ 77 | .codehilite .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ 78 | .codehilite .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */ 79 | .codehilite .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 80 | .codehilite .m { color: #009999 } /* Literal.Number */ 81 | .codehilite .s { color: #d01040 } /* Literal.String */ 82 | .codehilite .na { color: #008080 } /* Name.Attribute */ 83 | .codehilite .nb { color: #0086B3 } /* Name.Builtin */ 84 | .codehilite .nc { color: #445588; font-weight: bold } /* Name.Class */ 85 | .codehilite .no { color: #008080 } /* Name.Constant */ 86 | .codehilite .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ 87 | .codehilite .ni { color: #800080 } /* Name.Entity */ 88 | .codehilite .ne { color: #990000; font-weight: bold } /* Name.Exception */ 89 | .codehilite .nf { color: #990000; font-weight: bold } /* Name.Function */ 90 | .codehilite .nl { color: #990000; font-weight: bold } /* Name.Label */ 91 | .codehilite .nn { color: #555555 } /* Name.Namespace */ 92 | .codehilite .nt { color: #000080 } /* Name.Tag */ 93 | .codehilite .nv { color: #008080 } /* Name.Variable */ 94 | .codehilite .ow { color: #000000; font-weight: bold } /* Operator.Word */ 95 | .codehilite .w { color: #bbbbbb } /* Text.Whitespace */ 96 | .codehilite .mf { color: #009999 } /* Literal.Number.Float */ 97 | .codehilite .mh { color: #009999 } /* Literal.Number.Hex */ 98 | .codehilite .mi { color: #009999 } /* Literal.Number.Integer */ 99 | .codehilite .mo { color: #009999 } /* Literal.Number.Oct */ 100 | .codehilite .sb { color: #d01040 } /* Literal.String.Backtick */ 101 | .codehilite .sc { color: #d01040 } /* Literal.String.Char */ 102 | .codehilite .sd { color: #d01040 } /* Literal.String.Doc */ 103 | .codehilite .s2 { color: #d01040 } /* Literal.String.Double */ 104 | .codehilite .se { color: #d01040 } /* Literal.String.Escape */ 105 | .codehilite .sh { color: #d01040 } /* Literal.String.Heredoc */ 106 | .codehilite .si { color: #d01040 } /* Literal.String.Interpol */ 107 | .codehilite .sx { color: #d01040 } /* Literal.String.Other */ 108 | .codehilite .sr { color: #009926 } /* Literal.String.Regex */ 109 | .codehilite .s1 { color: #d01040 } /* Literal.String.Single */ 110 | .codehilite .ss { color: #990073 } /* Literal.String.Symbol */ 111 | .codehilite .bp { color: #999999 } /* Name.Builtin.Pseudo */ 112 | .codehilite .vc { color: #008080 } /* Name.Variable.Class */ 113 | .codehilite .vg { color: #008080 } /* Name.Variable.Global */ 114 | .codehilite .vi { color: #008080 } /* Name.Variable.Instance */ 115 | .codehilite .il { color: #009999 } /* Literal.Number.Integer.Long */ 116 | -------------------------------------------------------------------------------- /theme/css/local_fonts.css: -------------------------------------------------------------------------------- 1 | /* 2 | Stylesheet to load all local fonts except Font-Awesome because that is done by the theme. 3 | Add all new fonts below. 4 | */ 5 | 6 | @font-face { 7 | font-family: 'Inconsolata'; 8 | font-style: normal; 9 | font-weight: 400; 10 | src: local('Inconsolata'), local('Inconsolata-Regular'), url(../fonts/Inconsolata-Regular.ttf) format('truetype'); 11 | } 12 | 13 | @font-face { 14 | font-family: 'Inconsolata'; 15 | font-style: normal; 16 | font-weight: 700; 17 | src: local('Inconsolata Bold'), local('Inconsolata-Bold'), url(../fonts/Inconsolata-Bold.ttf) format('truetype'); 18 | } 19 | 20 | @font-face { 21 | font-family: 'Lato'; 22 | font-style: normal; 23 | font-weight: 400; 24 | src: local('Lato Regular'), local('Lato-Regular'), url(../fonts/Lato-Regular.ttf) format('truetype'); 25 | } 26 | 27 | @font-face { 28 | font-family: 'Lato'; 29 | font-style: normal; 30 | font-weight: 700; 31 | src: local('Lato Bold'), local('Lato-Bold'), url(../fonts/Lato-Bold.ttf) format('truetype'); 32 | } 33 | 34 | @font-face { 35 | font-family: 'Lato'; 36 | font-style: italic; 37 | font-weight: 400; 38 | src: local('Lato Italic'), local('Lato-Italic'), url(../fonts/Lato-Italic.ttf) format('truetype'); 39 | } 40 | 41 | @font-face { 42 | font-family: 'Lato'; 43 | font-style: italic; 44 | font-weight: 700; 45 | src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(../fonts/Lato-BoldItalic.ttf) format('truetype'); 46 | } 47 | 48 | @font-face { 49 | font-family: 'Roboto Slab'; 50 | font-style: normal; 51 | font-weight: 400; 52 | src: local('Roboto Slab Regular'), local('RobotoSlab-Regular'), url(../fonts/RobotoSlab-Regular.ttf) format('truetype'); 53 | } 54 | 55 | @font-face { 56 | font-family: 'Roboto Slab'; 57 | font-style: normal; 58 | font-weight: 700; 59 | src: local('Roboto Slab Bold'), local('RobotoSlab-Bold'), url(../fonts/RobotoSlab-Bold.ttf) format('truetype'); 60 | } 61 | -------------------------------------------------------------------------------- /theme/css/theme_child.css: -------------------------------------------------------------------------------- 1 | .wy-nav-top i { 2 | line-height: 50px; 3 | } -------------------------------------------------------------------------------- /theme/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /theme/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /theme/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /theme/fonts/Lato-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/Lato-BoldItalic.ttf -------------------------------------------------------------------------------- /theme/fonts/Lato-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/Lato-Italic.ttf -------------------------------------------------------------------------------- /theme/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /theme/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /theme/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /theme/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TeamNewPipe/documentation/ed03f04674cdf502fe956a545690bc7ae2efd029/theme/img/favicon.ico -------------------------------------------------------------------------------- /theme/main.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {# 4 | Override the stylesheets loading fonts from fonts.googleapis.com to prevent tracking 5 | This issue was discussed at https://github.com/TeamNewPipe/tutorial/issues/1 6 | You can find the original file at https://github.com/mkdocs/mkdocs/blob/master/mkdocs/themes/readthedocs/base.html 7 | 8 | While fixing the syntax highlighting (see https://github.com/TeamNewPipe/documentation/issues/5) 9 | I saw that some of the required scripts come from https://cdnjs.cloudflare.com. 10 | The libs block fixes most of this - except for some less frequently (and not by NewPipe or NewPipe Extractor) used languages. I kept the CDN script as fallback for these languages. 11 | #} 12 | 13 | {%- block styles %} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | {%- for path in extra_css %} 26 | 27 | {%- endfor %} 28 | {%- endblock %} 29 | 30 | {%- block libs %} 31 | {% if page %} 32 | 38 | {% endif %} 39 | 40 | 41 | {%- if config.theme.highlightjs %} 42 | 43 | {%- for lang in config.theme.hljs_languages %} 44 | 45 | {%- endfor %} 46 | 47 | {%- endif %} 48 | {%- endblock %} 49 | --------------------------------------------------------------------------------