DownloadManager does not let you set its proxy or change how it connects to
the internet. So we have to make a custom one, unfortunately. This is a
very basic downloader with none of the special sauce that makes the
built-in DownloadManager handy.
This makes sure that Orbot is running when the user expects it to be. If
NewPipe is configured to use Tor, then going to a NewPipe screen should
ensure Tor is running.
This adds an Application subclass to get the onCreate() method, which is
called once at the first start up of the app, before any Activity starts.
Tor is configured there to ensure it is setup before anything happens.
This also moves the "Use Tor" pref listener to a more appropriate place.
If the user has not changed the "Use Tor" preference, then the default
should be to use Tor if Orbot is installed. The user can still override it
by going an unchecking "Use Tor".
On all of the devices that I've checked, there is a folder called "Movies"
on the SD Card by default. NewPipe should use that standard location
since it is always downloading movies :). People can always change that
via the preferences.
Also, this makes the defaults the same when creating the dir and when
setting the destination URL.
This makes the app fully exit, and removes it from the Recent Apps listing
with the goal of hiding whatever the user was currently watching, and/or
searching for.
PanicKit provides a common framework for creating "panic button" apps that
can trigger actions in "panic responder" apps. In this case, the response
is to lock the app, if it has been configured to do so
https://dev.guardianproject.info/projects/panic/wiki
Also I added new variable `'final File dir`' with value of key
"download_path_preference" or externalStorageDirectory.
Firstly I check if dir exits, then eventually try to create it and next
- download file.
* ugly workaround for the details_view_layout problem on older devices
* removed "display button on the left side" option since it's not nececeay anymore.
* added VideoInfo(AbstractVideoInfo) constructor, to support later implementation for reusing info scraped into VideoPreviewInfo, into VideoInfo
* Made the Extractor class behave as a per-video object;
- most method return values are video-specific, so it makes sense (to me) to have Extractor be stateful.
- The only stateless methods are getVideoUrl(), getVideoId() and loadDecryptionCode(String)
* Implemented a constructor for YoutubeExtractor, which performs all initialisation work
* renamed VideoInfoItem to VideoPreviewInfo
* moved streaming service-related classes into their own, new package services
* added javadoc to some classes and methods (where functionality is known well enough to explain)
* De-duplicated common fields between VideoInfo and VideoPreviewInfo by moving them into a common superclass: AbstractVideoInfo
* Removed 2 methods which only call super(), and therefore are unnecessary: PlayVideoActivity.onResume() and PlayVideoActivity.onPostCreate(Bundle)
* still need to use the start position value stored in the PlayVideoActivity's Intent bundle, to set the VideoView using seekTo()
* need to test timestamp extraction regex, and possibly move it somewhere else
*need to find a better way to get the startPosition value to ActionBarHandler, which I thought used VideoInfo objects, but apparently doesn't
* currently there is a small setStartPosition() method
-replaced single use of terrible_unescape_workaround_fuck(String) with call to URLDecoder.decode(String, String)
* tested new regex implementation of YoutubeExtractor.getVideoId(String)
- deleted old HashMap-based implementation of YoutubeExtractor.getVideoId(String)
* Miscellaneous typo corrections
* replaced direct page-scraping extraction of video publication date in YoutubeExtractor.getVideoInfo(String) with jsoup-based scrape of <meta> tag field in YYYY-MM-DD format
*similarly, replaced direct page-scraping extraction of view count with <meta> tag field.
Both <meta> tag fields still need to be formatted locale-specifically
* moved on to version 0.6.0
* fixed youtube url sicnature encryption (vevo videos can be watched again)
* removed play action from the ActionBar
* rolled back changes for hiding the InfoBar inside PlayVideoActivity
* some small layout changes
* removed some files to be ignored (mostly inside .idea directory)
* etc