HACKING Genshiken
Table of Contents
- 1. FAQ
- 1.1. Q: Why do certain text strings contain strikethroughs in this document?
- 1.2. Q: I'm confused? What does this rainbow of asterisks mean!?
- 1.3. Q: What exactly is the main purpose of Genshiken, anyway?
- 1.4. Q: What makes Genshiken unique compared to common downloader/streaming clients?
- 1.5. Q: Can it really all be done in bash?
- 1.6. Q: Do I really have to read ALL the Manpages you've listed?
- 1.7. Q: Bash shell scripts can utilize a variety of programs/languages! Which should I expect?
- 1.8. Q: How should I indent when contributing source code?
- 1.9. Q: There are too many comments! Do I have to document my code the same way?
- 1.10. Q: I want to extend the command-line options of Genshiken. Any advice?
- 1.11. Q: If I create a new file for Genshiken, is there anything that I should include with it?
- 1.12. Q: Is there anything else I should consider when making a contribution?
- 1.13. Q: How do I get started?
- 1.14. [your questions here!]
- 2. newbie
- 3. Genshiken Hacker
- 3.1. Support an additional website
- 3.1.1. TODO Pending
- 3.1.2. TODO Pending Show-Type configure routine
- 3.1.3. Study
The Main Procedureof Genshiken - 3.1.4. Add a new Anime-Type (will soon be "Show-Type")
- 3.1.5. Review
Extract Series List; study how it operates on The Watchcartoononline.COM Network. - 3.1.6. Understand the order of expected execution that genshiken employs
- 3.1.7. Revise the man page to include the new Show-Type and it's arguments
- 3.1.8. Those who can accomplish this:
- 3.1.9. Those who can NOT accomplish this:
- 3.1.10. Genshiken is already functional! Supporting additional websites will be our main task.
- 3.2. [more recommendations can be discussed on the mailing list]
- 3.3. TODO A lot of what happens here will be added to a future info file as a tutorial!
- 3.1. Support an additional website
- 4. ideas / wishlist
- 4.1. TODO Support more video websites (See Support an additional website)
- 4.2. TODO manga/book download procedure
- 4.3. TODO Support more image websites (See Support an additional website)
- 4.4. TODO Create more rigorous parsing routines
- 4.5. TODO Add option
Episode Guide
to theAnime Prompt - 4.6. TODO Provide redirection, whenever the current series within a given site can't be loaded
- 4.7. [your hacking ideas here!]
- 5. fix bugs
- 5.1. TODO
ShowType_Configure
(not written, yet): ; not everything is an anime - 5.2. TODO
Restore_Previous_Session
: Different SessionTypes for the same show are ignored (only one is displayed) - 5.3. TODO
Size_Analysis
: Can't retrieve an accurate size of `Dailymotion' videos due to video fragmentation - 5.4. TODO
Download_File
: Allow `Dailymotion' videos to be downloaded, even from a fragmented video playlist - 5.5. [found a bug? Report it to the mailing list, and I'll add it here and will find a solution!]
- 5.1. TODO
- 6. ChangeLog discipline
- 7. Recording Contributors
Please Note:
- This file is best seen under GNU Emacs.
- The Org mode version of this
HACKING
file is the source for this document- If you prefer to view the same information from within GNU Emacs, then you may
download the
HACKING
file from CVS.wget -O HACKING http://cvs.savannah.gnu.org/viewvc/*checkout*/genshiken/share/doc/genshiken/HACKING?root=genshiken
- If you prefer to view the same information from within GNU Emacs, then you may
download the
- You may use the
HACKING
file as a Transparent copy of this document, in order to create similar documents. When doing so, you must follow the terms of the GNU Free Documentation license.
- The Org mode version of this
- All code blocks can be executed in GNU Emacs, from within the
HACKING
file- Place point on the code block and enter:
C-c C-c
- Place point on the code block and enter:
Figure 1: HOWTO for HACKING Genshiken
Last modified on December 30, 2016 at 22:15:48
This website is licensed under the GNU Free Documentation License.
Based on a work at cvs.savannah.gnu.org,
with the Invariant Sections being just "What is the purpose of Genshiken?"
Code blocks are licensed under the GNU General Public License v3, or later.
1 FAQ
1.1 Q: Why do certain text strings contain strikethroughs in this document?
ANSWER
- Please note that all strings (with exception to lines speaking of
open sourcesoftware) formatted with a strikethrough, refer to Org targets in Genshiken's source code. - Org targets are equivalent to external links, but referencing them online is a bit of a
challenge
- Reason #1 – I have to assume you have the source code already installed
- Reason #2 – These Org targets were meant to be seen within GNU Emacs, via Org mode
1.2 Q: I'm confused? What does this rainbow of asterisks mean!?
ANSWER
- These asterisks form Outlines
- Ps
- Try reading the rest of that manual while you're at it
1.3 Q: What exactly is the main purpose of Genshiken, anyway?
ANSWER
- Many proprietary software companies push video/audio formats that restrict access and restrict software developers.
- Now that HTML5 is here, we finally have a standard way to embed video onto a webpage
- Most plugins are nonfree, so who knows what they could be doing as they load your videos ::
Virtually all the video you’ve ever watched “on the web” has been funneled through a third-party plugin
– by Mark Pilgrim
Why is it that most companies or website administrators have not started using HTML5, yet? Could it be that they want to hide the locations of their videos via nonfree applications? Do they think that it's ethical to embed videos in a format that restricts users, and encourages them to install proprietary software?
True cyber security/privacy can NOT be maintained, unless free software is utilized! For how can we control our security/privacy with software, if we do not even have control of said software. Free software is the only kind of software that gives us control. I dare you to compare a free software license with a nonfree one, and tell me different! Also, there's no way of telling what malicious functions a plugin or browser-side script may have if it's nonfree!
Videos that require nonfree software, can be loaded via an external player instead; thus, bypassing the need for your browser to behave like a media player via plugins. Genshiken exists so that you no longer have to rely on plugins anymore, especially not the proprietary ones. Most importantly, you are always in control– combined with the 4 Essential Freedoms, Genshiken respects and promotes your freedom!
1.4 Q: What makes Genshiken unique compared to common downloader/streaming clients?
ANSWER
- Hackability (i.e. consider the file you're in…)
- Automatic playlisting
- Each supported website is treated like a playlist by default
- You can
provide argumentstotweak the playlist
- Automatic playlisting
- Ease of use
- Genshiken users don't need to enter a URL to find their videos
- Genshiken figures that out for them
- Some links may require
external programs
- There's even a
Restore Previous Sessionfunction- In essence, there's no need to remember the commands used to enter a playlist
- This small outline can't do this particular topic justice; refer to The Manpage
- Genshiken users don't need to enter a URL to find their videos
- It's a shell-script for crying out loud!
- A majority of free software command-line programs can be used within Genshiken!
- Most programming languages can be used within Genshiken
- In essence, Genshiken is not language specific
- Bash can simply be used as a container to your language of choice
- The core of Genshiken is browser and library independent!
- Why else is my Makefile so small?
- Most manuals are tens, hundreds, or even thousands of pages long
- Genshiken's manual is about 6 pages
- You CAN master this program!
1.5 Q: Can it really all be done in bash?
ANSWER
link-to-functions
- The very first program that most users [of a GNU/Linux operating system] encounter, is
GNU Bash
- Before GNU/Linux had a GUI, this was exactly the case. You were dropped into a shell at login
- Released in 1989, it has since been the default shell for the GNU/Linux operating system
- A majority of software packages still require the use of shell-scripts for installation
- Question: What do you think a Makefile is?
- Answer: A series of shell commands!
- Question: What do you think a Makefile is?
- You have NO reason not to learn it!
1.6 Q: Do I really have to read ALL the Manpages you've listed?
ANSWER
Bruce Lee: Absorb what is useful, Discard what is not, Add what is uniquely your own.
Bruce Lee: Be water, my friend
1.7 Q: Bash shell scripts can utilize a variety of programs/languages! Which should I expect?
ANSWER
- Novice level one-liner –
Grep and Sed Example - Intermediate level one-liner –
Find and Xargs Example(That IS a single one-liner) - Advanced level one-liner –
Sed Example(Ditto…) - Expert level one-liner –
GAWK Example
1.8 Q: How should I indent when contributing source code?
ANSWER
- Exceptions include:
aligning commands after a backquotealigning similar consecutive commands
- The key is to make the contribution human readable!
1.9 Q: There are too many comments! Do I have to document my code the same way?
ANSWER
What appears obvious now, may not be in the future– think ahead, before you write! It's also designed for newbies to read it… hint, hint
- Specifically, please follow these conventions:
- Add at least a one-line comment providing a brief synopsis of a function
- Each new function must be added to the functions directory as a single file
- Add at least 1-2 lines worth of comments to
blocks of code- You are encouraged to
go in depthfor key variables of a function - When test conditions seem a bit complicated:
Explain the criteria - Don't be afraid to fully explain the reasoning behind a
single statement Side commentsare recommended at specific times– use you're best judgement!- Consider adding your 2-cents to the man page, if it takes too much text to explain something
- You are encouraged to
- Add at least a one-line comment providing a brief synopsis of a function
1.10 Q: I want to extend the command-line options of Genshiken. Any advice?
ANSWER
Follow these conventions and ensure your contribution is compatible with this table.
1.11 Q: If I create a new file for Genshiken, is there anything that I should include with it?
ANSWER
A Copyright Notice and a License Notice.
RMS: Without a license notice giving permission to copy and change the file, the file
is
nonfree.
- In essence, you should follow these conventions
- Ps
- Consider using the overall Copyright Notice and License found in the readme
1.12 Q: Is there anything else I should consider when making a contribution?
ANSWER
- There is an ethical and philosophical consideration.
- Do NOT refer to proprietary programs!
- Do realize this is a free software project (i.e. NOT "Open Source")
- This one may not be so obvious, but… Genshiken is not POSIX.
- RMS: This "standard" we can do without
when that makes the GNU system better overall
in an objective sense.
- RMS: This "standard" we can do without
1.13 Q: How do I get started?
ANSWER
1.14 [your questions here!]
2 newbie
2.1 Read the FAQ, before you continue!
2.2 Are you good at bash shell-scripting?
2.2.1 If so, then I could use your help!
- E-mail me a link to your free software project so I can have a good idea of your skill level
2.2.2 If not, then that's okay! Begin tackling this newbie outline for success!
2.2.3 Proficient with a different language like Ruby, JavaScript, or Python?
- These are the types of languages that operate best on a website
- I could use support for languages like those in Genshiken!
- Your skills could prove useful for complex operations
- For simple operations, regular GNU programs are still preferred
- Python developer? See written in Python
- JavaScript/Ruby developer? See modifying JavaScript inside HTML tags
- Perl/Ruby developer? GNU Awk hacker? See Make REGEX more generic and efficient
- Your skills could prove useful for complex operations
2.3 Read Manpages within this HACKING file
2.3.1 Install org-man.el
- Relevant information for extending links can be found in Adding hyperlink types
lynx -dump \ 'https://www.gnu.org/software/emacs/manual/html_node/org/Adding-hyperlink-types.html' |\ sed -n '/;;;/,/;;;/ p' > org-man.el [[ $? -eq 0 ]] && echo -e "org-man.el has been downloaded successfully!" || echo "org-man.el could not be downloaded! Check your internet connection" >&2
- Move org-man.el to your load path
- Finally, load it via your .emacs init file
2.4 TODO Make Genshiken a GNU Project!
2.4.1 Enter C-h g
to learn more about the GNU Project
- If you are not in GNU Emacs: Click here!
2.4.2 If Genshiken becomes a GNU package, then all members of this project will be GNU Hackers!
- Please install standards.info & maintain.info, for I shall be referring to them
- If these links fail [in Emacs], (standards / maintain): Follow the below steps
- Browse The GNU Project Information site
- Download the maintain and standards tarballs from GNU's Project Information page
wget http://www.gnu.org/prep/maintain/maintain.info.tar.gz 2> /dev/null && wget http://www.gnu.org/prep/standards/standards.info.tar.gz 2> /dev/null [[ $? -eq 0 ]] && echo "Successfully downloaded two Project Information tarballs!" || echo "Could not download the Project Information tarballs! \ Check your internet connections" >&2
- Unarchive and uncompress them via
tar -xzvf *info.tar.gz
- Move the extracted info files to your emacs INFOPATH (e.g.
/usr/share/info/emacs-24
) - Add the below entries into your dir file:
GNU organization
- Maintaining: (maintain) Maintaining GNU software.
- Standards: (standards) GNU coding standards.
- Browse The GNU Project Information site
2.5 Grok GNU Bash (I mean it! Don't even continue, if you can't)
2.5.1 See Can it really all be done in bash
2.5.2 While you're at it, grok Abs
- Become familiar with The GNU Core Utilities
- Here are some things to consider with coreutils
- Become familiar with GNU Grep
- Become familiar with GNU Sed
- Become familiar with GNU Awk
2.6 Grok Genshiken
2.6.1 So… Genshiken is under a revision control system? What exactly is CVS?
- CVS newbies, read the official documentation: CVS–Concurrent Versions System
- Want to get on the fast track?
- The project homepage is: http://www.nongnu.org/cvs/
- A FAQ
- Here's An introduction
- Tips for CVS best practices can be found here
- The project homepage is: http://www.nongnu.org/cvs/
- Want to get on the fast track?
- CVS Resources on
GNU Savannah:- CvsAnonymous - For those who want to access a free software project
- Get access to the Genshiken Repository
- Genshiken CVS repo
- You will use a similar command as this one
- Passed the wrong if test? Become a project member!
- Genshiken CVS repo
- Get access to the Genshiken Repository
- CvsGettingStarted - For those who want to make a new free software project
- Read the free software Project Management-HOWTO
- See CVS best practices
- See
have a free software project
- See CVS best practices
- UsingCvs
- AccessToCVSROOT
- export $CVSROOT in your
.shrc
file (.e.g.export CVSROOT=/home/user/cvs-projects
)- This variable is also used in Genshiken's Makefile
- This variable is also used in Genshiken's Makefile
- export $CVSROOT in your
- CvsFromBehindFirewall
- CvsImportExistingProject
- CvsImportExistingRepo
- CvsRsyncWriteAccess
- CvsDisabling
- Read the free software Project Management-HOWTO
- CvsAnonymous - For those who want to access a free software project
2.6.2 You are wrong if:
- You are not in GNU Emacs!
- Quit whichever program you are using right now! This file was designed for Org mode.
- For terminal users, enter this:
emacs -nw share/doc/genshiken/readme.org
- For GUI users, enter this instead:
emacs share/doc/genshiken/readme.org
- Quit whichever program you are using right now! This file was designed for Org mode.
- You say:
- "Genshiken is
open sourcesoftware!" - "It's
more practicalthan most downloader/streaming clients."- Review Genshiken's License Notice
- Review Genshiken's License Notice
- "Genshiken is
- You read this file before the readme
- You are NOT interested in the NEWS
- Important announcements will not be sent as a bulk E-mail!
- They'll be published as an official news article, so stay in the loop
- I will be following these conventions
- They'll be published as an official news article, so stay in the loop
- Comments from a project member can make their way into the NEWS file
- Subscribe to the Atom feed (e.g. utilize Live Bookmarks or a Feed Reader)
- Subscribe to the mailing list. Learn more here.
- Important announcements will not be sent as a bulk E-mail!
- You haven't downloaded AND installed Genshiken!
- You don't have a copy of the repository
- You've never executed
genshiken –source-code - You haven't tried streaming/downloading with the
–verboseoption - You've tried tackling the ideas / wishlist or fix bugs while still a newb!
- You copied code from another free software project, without giving them proper credit
- You've contributed code, but you're mad when I say: it needs to be cleaned up, first.
- You've added to The TODO list when it's actually my responsibility as Project Admin
- This may change if you become a project member, and I've deemed your skills useful enough
- How do I become a project member?
- Use the request for inclusion form located on GNU Savannah, to become a member!
- What is GNU Savannah?
- GNU Savannah is where the gnu roam
- This is why you should choose Savannah
- Do you have a free software project, too? Register it Here!
- GNU Savannah is where the gnu roam
- If you are a project member, and no longer a newbie: See Genshiken Hacker
- Use the request for inclusion form located on GNU Savannah, to become a member!
- How do I become a project member?
- This may change if you become a project member, and I've deemed your skills useful enough
3 Genshiken Hacker
3.1 Support an additional website
3.1.1 TODO Pending 5.1
3.1.2 TODO Pending Show-Type configure routine
3.1.3 Study The Main Procedure of Genshiken
3.1.4 Add a new Anime-Type (will soon be "Show-Type")
3.1.5 Review Extract Series List; study how it operates on The Watchcartoononline.COM Network.
3.1.6 Understand the order of expected execution that genshiken employs
- Review the functions
directory- These functions are named using numbers that reflect the expected execution order
- All functions are
sourcedat run-time (The Makefile is tasked with modifying this value) - These functions may execute at anytime:
- func0-cleanup.sh
- func1-early-termination.sh
- func2-restore-monitor.sh
- All
gfunc-*
files are executed with:genshiken --get Anime-Type
genshiken --stream Anime-Type
- All
vfunc-*
files are executed with:genshiken --view Anime-Type
- These functions are named using numbers that reflect the expected execution order
- Study this
While Loop.
3.1.7 Revise the man page to include the new Show-Type and it's arguments
3.1.8 Those who can accomplish this:
- Work on the ideas / wishlist, fix bugs, tackle The TODO list, or Support an additional website
3.1.9 Those who can NOT accomplish this:
- Add to the ideas / wishlist or fix bugs
- Perhaps add questions to the FAQ if confused
3.1.10 Genshiken is already functional! Supporting additional websites will be our main task.
3.2 [more recommendations can be discussed on the mailing list]
3.3 TODO A lot of what happens here will be added to a future info file as a tutorial!
4 ideas / wishlist
4.1 TODO Support more video websites (See Support an additional website)
4.2 TODO manga/book download procedure
4.3 TODO Support more image websites (See Support an additional website)
4.3.1 Pending manga/book download procedure
4.4 TODO Create more rigorous parsing routines
4.4.1 TODO Learn from youtube-dl - Written in Python, for downloading videos or music
- Python developer might be needed here!
- Either extend youtube-dl, or add your code directly into Genshiken
- If you want, you can even replicate youtube-dl inside of Genshiken
- youtube-dl supports 'youtube-like websites'; let's support non-youtube-like websites
4.4.3 TODO Make REGEX more generic and efficient for better use with different websites
- Perl or Ruby developer might be needed here!
- GNU Awk Hacker might be needed here!
- Please refer to change specific variables that utilize REGEX, for your first task
4.5 TODO Add option Episode Guide
to the Anime Prompt
4.6 TODO Provide redirection, whenever the current series within a given site can't be loaded
4.6.1 TODO Provide redirection, whenever the current episode within a given series within a given site can't be loaded
4.7 [your hacking ideas here!]
5 fix bugs
5.2 TODO Restore_Previous_Session
: Different SessionTypes for the same show are ignored (only one is displayed)
5.3 TODO Size_Analysis
: Can't retrieve an accurate size of `Dailymotion' videos due to video fragmentation
5.4 TODO Download_File
: Allow `Dailymotion' videos to be downloaded, even from a fragmented video playlist
5.5 [found a bug? Report it to the mailing list, and I'll add it here and will find a solution!]
6 ChangeLog discipline
6.1 Based on the GNU coding standards
6.2 Ensure to update the ChangeLog with any changes you make to Genshiken!
- This is accomplished automatically via cvs2cl (install it if you don't have it)
6.3 The ChangeLog will be for tarball users only (refer to the Makefile for details)
7 Recording Contributors
7.1 Based on the The GNU Maintainers Guide
7.2 Once you start contributing to Genshiken, I will add your name to the AUTHORS file
7.2.1 The format is savannah-user-name:real-name <email-address>:GnuPG-Key-ID:Description of contribution
- If your contribution does not include code, the first field may be omitted
- One-line of code
- A trivial idea you suggested, that makes its way into Genshiken
- Free documentation that you provide for Genshiken
In essence, any contribution to Genshiken will be recorded in the AUTHORS file. Not sure whether something should be added/not? Discuss it on the mailing list!