Comments (8)
One thing I'm not following....is can't this already be done using the StartFileDownload API call? It sounds like #2 is already implemented. Take a look at the overloaded StartFileDownload API call in sage/api/Global.java. IIRC, that's why I added that argument in the first place. :)
And the main reason this was never set as the default was I didn't want SageTV getting blacklisted from specific sites.
from sagetv.
At a glance, it didn't look like StartFileDownload actually passed through anything but ServerAddress, SourceFile, and DestFile when it calls downloadFile.
from sagetv.
On another look, it looks like StartBackgroundFileDownload handles the props...
from sagetv.
but StartFileDownload and StartCircularFileDownload do not.
from sagetv.
Ahh yes, you are correct. :)
OK, I'd propose making 2 changes then.
- Have a property such as "use_sagetv_user_agent" which then uses "SageTVa.b.c" as the user agent (and it would default to not being on for backwards compatibility)
- Add an overloaded StartFileDownload API call which takes a RequestProperties parameter so this can force the user agent to whatever it wants.
That all sound good?
from sagetv.
Sounds prefect. I had originally envisioned a single property that would simply override the user agent all the time, but later realized this would not really be proper, and any workaround user agent spoofing should be done on a case by case basis, so this solution should work best. Default to old behavior, ideal having the property turned on which would have a "proper" default SageTV user agent, and provide a case by case way to workaround individual site issues with a spoofed user agent.
So, this would require downloadFile to generate a default, and apply it, if desired by global property, BEFORE the requestProps are iterated through. Then the addition to the other Global API calls to pass through the props if there.
from sagetv.
Looks like I'll need some help if I'm going to complete this issue. I'm not sure how, or if, the API functions CAN be overloaded. Or at least if they can, I'm not sure about the way to go about doing so. This leaves the only option to create a new API call (StartFileDownloadWithProps) with the properties attached. I'm guessing there's no problem with doing this, it just means that any stv's or libraries that might benefit from the change will have to make sure to use the proper call.
from sagetv.
Take a look at the "SageCommand" API call in Global.java. That gives you an example of how it's done. The few things you need to notice are:
- The # of parameters for the method is declared as -1 (in the constructor)
- It uses the 'curNumberOfParameters' variable to determine how many arguments there are and then does the appropriate thing after that.
- There's 2 javadoc comments, one for each method
from sagetv.
Related Issues (20)
- dependence on libpng12-0 for mplayer
- Default recordings as MPEG-TS? HOT 1
- SageTV Forums down for ‘server relocation’ anyone know when they will return? HOT 3
- Change channel scanning upper limit for US and Canada HOT 1
- double zip codes HOT 1
- How to fix tuners not working and get rid of all the accumulated unused channels HOT 1
- Watched icon/flag behavior HOT 3
- Please open a security advisory HOT 4
- Travis CI integration no longer working HOT 6
- Playback of file crashes when loading external SRT file HOT 3
- Difference in Sage.jar between Windows and Linux builds HOT 6
- How to use EPGDBPublic2.java HOT 1
- Fix existing tuner input type to display all options and configure, it currently does not HOT 4
- Scheduled Direct duplicate program requests HOT 13
- SageTV is making too many celebrity requests on Schedules Direct HOT 3
- Security Policy violation Binary Artifacts HOT 2
- Extract Media Description from video file
- Import folders or media with extenced ascii characters are ignored
- LinuxMPlayerPlugin.java: video out parameter? HOT 1
- Guide data/Manual Recording issue with padding less than show length HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sagetv.