URL upload to onedrive & use it as source for stream

Hi Rajesh,

OneDrive is primarily designed to store Office documents. It probably has quirks and limitations if primarily used as a backend for streaming.

This is the solution I find best to stream Netflix videos:

It is has good picture quality, is robust and simple to use, which saves me a lot of time thereby allows me to earn more than enough to pay the subscription.

My best advice is therefore to spend your time and talent on something (legal) that will increase your (long term) income.

@asdffdsa @Animosity022 @Ole

Thanks alot for all knowledge and support. Jellyfin wasn't working. So, I have dropped it & started using emby server. Now all works fine. Media sync with onedrive, copyurl too.

But started getting this error at times. How to fix it..?


ubuntu@ubuntu:~$ rclone ls onedrive:
2022/01/03 21:14:00 Failed to create file system for "onedrive:": failed to get root: Get "https://graph.microsoft.com/v1.0/drives/root": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect onedrive:": oauth2: cannot fetch token: 401 Unauthorized
Response: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: 78984d4d-15a8-4474-a4bf-fa0e51333402\r\nCorrelation ID: 100cb8dd-f2ce-4104-8473-c6d76dfaee0d\r\nTimestamp: 2022-01-03 21:13:59Z","error_codes":[7000215],"timestamp":"2022-01-03 21:13:59Z","trace_id":"78984d4d-15a8-4474-a4bf-fa0e51333402","correlation_id":"100cb8dd-f2ce-4104-8473-c6d76dfaee0d","error_uri":"https://login.microsoftonline.com/error?code=7000215"}
ubuntu@ubuntu:~$


good,
in testing, i found jellyfin somewhat unstable, compared to emby.
so that is why i use emby.

and yesterday, i uploaded 600TB to my onedrive account, created a emby library.
so far streaming is perfect, seeking is near instantaneous.

about that error, as per the message, run
rclone config reconnect onedrive

Omg 600TB of cloud storage. Nice.


rclone config reconnect onedrive: (As per below)


ubuntu@ubuntu:~$ rclone config reconnect onedrive:
Already have a token - refresh?
y) Yes (default)
n) No
y/n> y
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine

y) Yes (default)
n) No
y/n> n
Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
        rclone authorize "onedrive" ""
Then paste the result.
Enter a string value. Press Enter for the default ("").
config_token> code for remote machine given here


Couldn't decode response - try again (make sure you are using a matching version of rclone on both sides: invalid character 'e' looking for beginning of value

Option config_type.
Type of connection
Enter a string value. Press Enter for the default ("onedrive").
Choose a number from below, or type in an existing value.
 1 / OneDrive Personal or Business
   \ "onedrive"
 2 / Root Sharepoint site
   \ "sharepoint"
   / Sharepoint site name or URL
 3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite
   \ "url"
 4 / Search for a Sharepoint site
   \ "search"
 5 / Type in driveID (advanced)
   \ "driveid"
 6 / Type in SiteID (advanced)
   \ "siteid"
   / Sharepoint server-relative path (advanced)
 7 | E.g. /teams/hr
   \ "path"
config_type> 1
Failed to query available drives: Get "https://graph.microsoft.com/v1.0/me/drives": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect onedrive:": oauth2: cannot fetch token: 401 Unauthorized
Response: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: 98ef79a4-ef25-422a-bf0b-843960766602\r\nCorrelation ID: 193432eb-fcc3-4c8e-84ba-9f874720ed98\r\nTimestamp: 2022-01-03 21:30:29Z","error_codes":[7000215],"timestamp":"2022-01-03 21:30:29Z","trace_id":"98ef79a4-ef25-422a-bf0b-843960766602","correlation_id":"193432eb-fcc3-4c8e-84ba-9f874720ed98","error_uri":"https://login.microsoftonline.com/error?code=7000215"}


oops, i meant 600GiB

What did you use to upload 600TB?

API limits are about scaling and not a single stream. What did you use to mount? Defaults? We can give some tips for mounting to folks using OneDrive if your configuration works well.

my bad, just 600GiB

yes, i agree, that is why i believe streaming from onedrive works well, in the past and now.
in a week or so, of using only onedrive for emby streaming, i will know more.

i wonder if there is a difference between onedrive personal and office365 business?
as i use office365 business.

Neat. Maybe a new post so we don't grab this one. Onedrive doesn't have any pacer (like Dropbox and many other remotes / Google Drive has a built in pacer on it configured with their API quotas) so that's pretty crazy if you did a scan and get not pacing at all other than that one message.

I'd imagine there is a pretty notable difference between personal and business but that is just a guess. With no paced remote, rclone usually hammers it and breaks with a mount and doing a Plex/Emby scan.

i am just a low down law breaker, so i have time to do a bunch of testing and start a new post.

as this is about onedrive, shame that ole cannot comment.
too busy spending time and talent to increase long term legal income.

about that error, as per the message, run
rclone config reconnect onedrive

As this was not working. What I am doing for now removing all remotes from windows pc & virtual instance ubuntu server. Then create new remote with same name on both machine. Then copy all content of rclone.config file.

Paste in virtual instance ubuntu server rclone.conf file & save it.

That is now currently I am working.

rclone config reconnect onedrive:


It was not refreshing config token.

need only to create a single rclone config file, and then just copy the rclone.conf to other machines.

I can copy / move to physical machine. Ubuntu server is on oracle cloud vm instance. So, how to do it on that..?

That's why I have used

nano rclone.conf

To paste content copied from windows PC.

copy/paste text is never a good idea, between windows and linux.
unless you are very careful and know how to deal with end of line character differences.

just copy the rclone.conf as you would copy any file

Yeah I understand that. But I am using SSH session from PUTTY to access ubuntu vm instance.

So, how to copy from windows PC to ssh session. Any windows software..?

just do an internet search

have not used putty in many years, as i prefer the free bitvise client.
bitvise sells a ssh server for windows, and i have used that a few times over the years.
the bitvise client has a nice sftp/scp dual pane gui to transfers files.
also, bitvise can mount an sftp as drive letter, same as rclone mount

much like rclone mount

if the ubuntu server has sftp server, use filezilla client.

i think you can use winscp but again have not used that in years.

Yeah. Started using now WINSCP for windows. It serves the requirement.

A doubt, how I can make below command as file which can be executed on linux server. I mean such as .bat / .exe

/usr/bin/rclone rc vfs/refresh recursive=true

File compatible with linux. Currently I am doing copy & paste for refresh of rclone mount.

search the internet, run remote command over ssh using putty

Thanks alot for direction. Did this to achieve my needs.

Steps followed -

1. nano rcloneremote.sh

2. #! /bin/sh
      /usr/bin/rclone rc vfs/refresh recursive=true


3. Saved it by doing CTRL+X then pressed Y then pressed ENTER


4. bash rcloneremote.sh

And wow here is the output from terminal -

{
        "result": {
                "": "OK"
        }
}

But what just thinking putting this line of code into rclone mount as below -


ExecStartPost=/usr/bin/rclone rc vfs/refresh recursive=true

So, I don't know much about linuxserver, it will ran after successful rclone mount. It will running always.

I will only scan libraries from jellyfin.

But don't know what adverse effect it will have...??

no adverse effects, many rcloners do that.

tho most rcloners use a command like so.
ExecStartPost=/usr/bin/rclone rc vfs/refresh recursive=true _async=true

Yeah exactly what I was thinking to do. Let's take benefits of automation. Anyway I won't be deleting that rcloneremote.sh file

I will just add this line of code to my rclone mount. And will always refresh media scan in jellyfin.

Now I am thinking how I can run script which will do rclone copyurl for multiple links and upload them to one-by-one.